Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Variables changing to Incompatible type

(1) ShareShare
ReportReport
Posted on by 183
I have a global variable that is included for moving form to form or is included in a gallery.
The variable is Set(CurJob,Job_ID where Job_ID is a varchar text field in a AZURE SQL database.  Variable works fine throughout the application.
Variable Check shows CurJob(Text,"")
 
If I change the source of a gallery in Design mode by adding a filter for a column - from Filter(Gallery1,Builder="AB") to Filter(Gallery1,Builder="YZ"), the variable CurJob will cease to function throwing "Incompatible Type" errors.
Under the Variable Check, the it now shows CurJob(Text:Blank).
 
There seems to be nothing I can do within the Design session to reset the variable, CurJob, to a text type of "" or any other Text, "101".
 
The only way I can resolve this error is to save/publish/close app and then reload in design.  CurJob text variable is again functioning as expected.
 
 
 
 
Categories:
  • lknudson1 Profile Picture
    183 on at
    Variables changing to Incompatible type

    Original Item data source for gallery – filtered Azure SQL Database View, v_PaintJobList (no errors)
    Original Devault value for gallery (no error)



    Value for tmpJob is ‘Blank’ on gallery open.
    No errors in running gallery with runtime.




    I then go to Design mode to make a change.

    Change gallery source to same SQL View, v_PaintJobList, but I remove the filter.

    Error is introduced.


    Error shown on gallery Default value.

    Every other use of global variable tmpJob now has same error.

    I don’t see value of tmpJob assigned anything other than a new text value in Variable Definitions.
  • Suggested answer
    Michael E. Gernaey Profile Picture
    40,272 Super User 2025 Season 1 on at
    Variables changing to Incompatible type
    Hi
     
    Firstly, please provide all the details of the error, not just the "generic", as right now I have no idea where in the App its happening etc as there are no pictures.
     
    If you are getting Compatibility type issue that means only several possible things
     
    1. You changed the source and the data types are different between them so now the Variable doesn't match
    2. You have the variable in many places and at least one of them is trying to change it
    3. My belief is simple, when you are publishing and reloading your are zeroing out all data variables etc. So when it first comes back you are good, but I expect it to happen again, as soon as it hits the code section that the current type doesn't fit
     
    The reason its important to share the other details of an error is honestly most of the time the answer is obvious when you look at it from the perspective of the red squigles and the exact verbiage like
     
    Compatibility Error
    You are comparing Text and Record.
     
    Thats what we need. Then we can help you determine why in that spot is the left side or the right side of the expression changing or not right
     
     
     
     
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard