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 / Setting value based on...
Power Apps
Answered

Setting value based on global variable

(0) ShareShare
ReportReport
Posted on by 270

I have a number field in my app. To choose what number to insert, the user has the option to click on the field's text, that navigates the app to a screen with a set of pictures and for each picture there's a number. Clicking on a picture sets a global variable to that number and then that number should be put into that field. The thing is that no matter what, it doesn't seem to work.

I don't where I should put that global variable because it either resets to what there was before or it changes for all the items in the list.

I figured it should go in the default of the datacard or the default of the datacardvalue or in the update.

Please help me, I'm at a loss

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @msabau ,

     

    So, if users have not selected a picture, it should be the default value, otherwise the variable instead:

    If(IsBlank(Variable), Parent.Default, Variable)

     

    If you will need to clear the inputs and reset to default, set the variable to Blank()

     

    Best regards,

  • msabau Profile Picture
    270 on at

    I think something is wrong, because when I choose the picture, the correct value stays there for a couple of seconds, then it resets to Blank by itself.

    I think it happens because the default value well is blank, but to my knowledge, it shouldn't automatically update

     

    EDIT: Solved it, I had a formula in OnVisible that reset that field. I deleted it and now it's working as intended

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @msabau ,

     

    Please add a Label anywhere on the same screen as the pictures and set Text to the variable. Use double-slashes "//" to temporarily deactivate the Navigate function if there was, and check if the variable will automatically change after choosing a picture.

     

    Best regards,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard