Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Error Handling
Suggested answer

Error Variable set (incompatible with the types of values in other places in your app)

(0) ShareShare
ReportReport
Posted on by 478
Hi,
 
When i'm trying to set a variable on multiple screens i get this error message:
 
Incompatible type. We can’t evaluate your formula because the context variable types are incompatible with the types of values in other places in your app.
 
Here is the Variable i use; 
Set(PDD1;TextInput4_42.Text)
and the other variables set also to "PDD1"
 
Set(PDD1; If(CountRows(colNCOLIS) >= 1; First(colNCOLIS).Weight; Blank()))
Set(PDD1; If(CountRows(colNCOLIS) >= 1; First(colNCOLIS).Weight; Blank()))
One of these variables is located on OnTimerEnd of a timer control  and the two others a select of a button control.
 
What does this error means? and how to avoid this kind of error next time?
 
This variable is used to show weight values on a label control.
  • WarrenBelz Profile Picture
    148,275 Most Valuable Professional on at
    Error Variable set (incompatible with the types of values in other places in your app)
    OK - the issue is the opposite - if the Weight field in colINCOLIS is Text then you also need to ensure that the output of TextInput4_42 is rendered to Text, so
    Set(
       PDD1;
       Substitute(
          Text(
             Value(TextInput4_42.Text);
             "[$-fr-FR]0.00"
          );
          ".";
          ","
       )
    )
    and then your original code
    Set(
       PDD1; 
       If(
          CountRows(colNCOLIS) >= 1; 
          First(colNCOLIS).Weight; 
          Blank()
       )
    )
    The issue here is that a Variable needs to be set to the same data type everywhere you set it, so in the case, it would be Text.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee
  • Sormick Profile Picture
    478 on at
    Error Variable set (incompatible with the types of values in other places in your app)
    This value is a number with two decimals get from a sharepoint list with the creation of a collection:
     
    ClearCollect(
        colNCOLIS;
        FirstN(
            ShowColumns(
                Filter(
                    CP78RECTIFCP87;
                    Dispatch = Label11.Text && OBSERVATIONS = "MISSING"
                );
                'Item ID';
                Weight;
                'Destination Country'
            );
            10
        )
    )
     
    and set this variable to get the weight value of my collection colNCOLIS
     
    Set(PDD1; If(CountRows(colNCOLIS) >= 1; First(colNCOLIS).Weight; Blank()))
     
     
    This weight must be shown on a Label on a form.
     
    Now i'm trying this function to get the new weight for my new textinputbox:
     
    Set(
        PDD1;
        Substitute(
            Text(
                Value(TextInput4_42.Text);
                "[$-fr-FR]0.00"
            );
            ".";
            ","
        )
    )
    But i still get the same error:
     
    Incompatible type. We can’t evaluate your formula because the context variable types are incompatible with the types of values in other places in your app.
  • Suggested answer
    StretchFredrik Profile Picture
    3,029 Super User 2025 Season 1 on at
    Error Variable set (incompatible with the types of values in other places in your app)
    Hello,
     
    The error means that you for example first set your variable to a text value, and in another place, you set it as a number value. This is not allowed. A variable must be the same type everywhere in your app. So in your case, if you do for example:
     
    Set(PDD1;Value(TextInput4_42.Text))
     
    it should work. Because then the variable is always a number.
     
    If my response solved your issue, please mark it as ✅ Accepted Answer and give it a like.
  • WarrenBelz Profile Picture
    148,275 Most Valuable Professional on at
    Error Variable set (incompatible with the types of values in other places in your app)
    What type of field is Weight ? If it is a number, then the first one should be
    Set(
       PDD1;
       Value(TextInput4_42.Text)
    )
    The second should work, but this may be better
    Set(
       PDD1; 
       If(
          CountRows(colNCOLIS) >= 1; 
          First(colNCOLIS).Weight; 
          0
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 770 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 494

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 399

Featured topics