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 / Correct formula to use...
Power Apps
Unanswered

Correct formula to use for a global variable.

(0) ShareShare
ReportReport
Posted on by 83

I have a screen that lists different items. When you select on item it asks a yes or no question then it takes you to an editform. The formula used for one item is Set(VarCommodity, "Avocado"); Navigate (Editscreen).  The formula used for the next item is Set (VarCommodity2,"Honeydew"); Navigate (EditScreen). These are both global variables. On my edit screen what type of formula can be used in the IF formula so the right commodity can be selected depending on the button that was selected? There is button one for Avocado and button two for honeydew. Should the if formula incorporate the buttons so the correct item is entered in the commodity selection?

Categories:
I have the same question (0)
  • PA_nerd Profile Picture
    63 on at

    If VarCommodity and VarCommodity2 are not being used for any other purpose, I would only use 1 variable, such as VarCommodity.  Then on EditScreen you can check to see which value was selected by using a label with the Text property of VarCommodity

     

  • CU06111240-0 Profile Picture
    83 on at

    Thank you for your response. The formula works. However, I have a log that tracks the items my commodity item is not being logged at all. How do I change the formula to correct this issue?

    tchamb2_0-1698888767323.png

     

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard