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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard