I am trying to find a way to count numbers using an up and down icon with a text input for number.
A variable will unfortunately not work in this case, you will need to update the number column of that specific row via a Patch() statement. (see first comment)
This will update your collection or datasource on an item level.
I hope this helps!
Hi again @SpongYe! I found it and solved the issue. However, the number remains the same for other items, but I would like different numbers for each item. I see that’s I was wrong about TextInput, should be Label. How it’s work with Label of numbers for each item? Please let me know! 🙂
To create a number input with up and down buttons in Powerapps is to use the following steps:
Create a variable to store the number value. Using the Set function in the OnStart property of the app or the OnVisible property of the screen.
Set(varNumber, 0)
Create two button controls, one for incrementing and one for decrementing the number value. Set their OnSelect properties to update the variable using the Set function.
OnSelect:
Set(varNumber, varNumber + 1)
Increase the value of varNumber by 1 when the button is pressed.
OnSelect:
Set(varNumber, varNumber - 1)
Decrease the value of varNumber by 1 when the button is pressed.
If you have any questions or feedback, please let me know. Have a great day! 😊
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻
Hi @dylandavis09,
Are you storing the number in a column? With the code below I expect a number column and that the item is being displayed in a gallery:
//OnSelect of the up icon
Patch(
Datasource,
//In case the column schema does not fully match use LookUp(DataSource, ThisItem.ID = ID) instead of ThisItem
ThisItem,
//or -1
{NumberColumn: ThisItem.NumberColumn + 1}
)
If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.
Thanks!
WarrenBelz
146,601
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,946
Most Valuable Professional