web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Problem with Set() fun...
Power Apps
Answered

Problem with Set() function

(0) ShareShare
ReportReport
Posted on by 52

Hi,  

 

I am facing an problem with Set() function. The problem that is showed to me is the following:

"The global variable types specified are compatible with the types specified elsewhere".

 

For the record, I change the variable several times in different screens with Set() function (including first screen OnVisible).
However, if I change the variable name the problem disappear, but if I save the app and re-open it the problems appear again.

 

Please fix or help to fix that bug.

 

Thanks,
Rui Barbosa

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi RuiBarbosa,

     

    How is the your code configured? Could you show me your code to help reproduce this issue on my side?


    To test this issue, I set the screen’s OnVisible property as Set(test,1). Add a Label control and set its Text property as test. The value will be shown on the label when I navigate to this screen.


    Another simple test, add a button control and set its OnSelect property as Set(click,click+1), add a Label control and set its Text property as click. When the button is clicked, the calculated value will be shown on the label.


    I don’t get any error message when I use the Set() function. Please show me more details to reproduce this issue.

     

    Best regards,
    Mabel Mao

  • Verified answer
    RuiBarbosa Profile Picture
    52 on at

    Hi @v-yamao-msft,

     

    Thanks for the response.

     

    I already fixed the problem. I had a Patch() into Set() function and the "The global variable types specified are compatible with the types specified elsewhere" error appeared to me.

     

    I removed the Patch() and changed the body of Set(), and everything works fine now.

     

    Thanks,

    Rui Barbosa

  • ngabougaifan Profile Picture
    54 on at
    Hi RuiBatbosa

    Could you share more on how did you fix the problem by removing the patch from set function? I’m facing similar issue and it’s frustrating. Thank you.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard