Hi,
I am new to Power Apps. I am trying to build an app that can serve as a simple Point-of-sales app for a pop-up bar to keep a tally of different drinks sold. Idea is to have several buttons in the main screen where the user can configure to point explicitly to a specific record (ie: the drink record the button is associated with). The button would display the name field of the record and at each click it would increase the "number of drinks sold" field (alternatively, it can keep a tally stored in a variable and then patch it to the record at the end).
My question is how do I configure a button (or a label) to point to a specific record without hardcoding it? Because the user should be a able to change the record (drink) the button is associated with as their menu changes daily.
Hope I have given enough info. Thanks in advance.
Cheers!
Pathum
Solved! Go to Solution.
Hi @PathumBandara ,
It'd be better to post some screenshots and sample data about your app to help us understand your scenario more quickly.
In this case, you want the button to increase the number of drink sold field value of the drink record that is relate to the button, but not hardcoded, right?
Not hardcoding mean you can change the button to associate with other drink records at anytime, so first I think there should be a a Gallery/drop-down or other controls with the same functionality to let the user choose a drink, then associate the selected drink to the button to increase the sold number.
Gallery.Items:
'Drink List'
Button.OnSelect:
Set(varSelectedDrink, LookUp('Drink List', DrinkName=Gallery.Selected.DrinkName));
Patch('Drink List', varSelectedDrink, {'Number of Drink Sold': varSelectedDrink.'Number of Drink Sold' +1})
Hope this helps.
Sik
Hi @PathumBandara ,
It'd be better to post some screenshots and sample data about your app to help us understand your scenario more quickly.
In this case, you want the button to increase the number of drink sold field value of the drink record that is relate to the button, but not hardcoded, right?
Not hardcoding mean you can change the button to associate with other drink records at anytime, so first I think there should be a a Gallery/drop-down or other controls with the same functionality to let the user choose a drink, then associate the selected drink to the button to increase the sold number.
Gallery.Items:
'Drink List'
Button.OnSelect:
Set(varSelectedDrink, LookUp('Drink List', DrinkName=Gallery.Selected.DrinkName));
Patch('Drink List', varSelectedDrink, {'Number of Drink Sold': varSelectedDrink.'Number of Drink Sold' +1})
Hope this helps.
Sik
Hi @v-siky-msft
Thank you so much for your help. I have been banging my head to figure this out, when the solution was as simple as using a dropdown in the button. I'm so glad I asked for help. And your patch formula is exactly what I needed.
Cheers!
Pathum
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
215 | |
180 | |
138 | |
96 | |
82 |