Hello,
looking for something really simple
bit can’t figure it out.
in a label , I would like to show the amount of clicks someone presses a button. At work we have to count certain items but they are everywhere so it’s just easy to click a button as we see the item and automatically shows the count .
for example
the label would show “20” if I pressed a button 20 times.
thank you!!
Solved! Go to Solution.
Hi @Sahara22,
You can simply do something like this in the OnSelect of the button:
Set(gblCount, gblCount+1)
Or
UpdateContext({locCount: locCount+1})
Or
Collect(colCount, CountRows(colCount)+1)
And then you can set the Text property of the label to:
gblCount or locCount or CountRows(colCount)
Let me know if this helps.
---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions.
Thanks!
Hardit Bhatia
Microsoft Business Applications MVP
Microsoft Certified Trainer MCT
Hi @Sahara22,
You can simply do something like this in the OnSelect of the button:
Set(gblCount, gblCount+1)
Or
UpdateContext({locCount: locCount+1})
Or
Collect(colCount, CountRows(colCount)+1)
And then you can set the Text property of the label to:
gblCount or locCount or CountRows(colCount)
Let me know if this helps.
---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions.
Thanks!
Hardit Bhatia
Microsoft Business Applications MVP
Microsoft Certified Trainer MCT
Thank you @PowerAddict ,
i actually have one more sorry. I’m trying to now rest set the value of the table so it can start at zero again but the “Reset(BT.text)” won’t work on another button (the reset button on) . “BT” is the label name.
thank you!! 🙂
Wherever you want to reset the count, depending on the approach you picked you can do one of the following:
Set(gblCount, 0)
Or
UpdateContext({locCount: 0})
Or
Clear(colCount)
Let me know if this helps.
---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions.
Thanks!
Hardit Bhatia
Microsoft Business Applications MVP
Microsoft Certified Trainer MCT
Wow thanks again @PowerAddict . Ok last question I promise. Now I want to make another button that sends the count to an email, for example I have this:
Try this:
Office365Outlook.SendEmail("email@hotmail.com", "Stock Count", "Here are the Counts: " & gblCount);Navigate('Home Page')
---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions.
Thanks!
Hardit Bhatia
Microsoft Business Applications MVP
Microsoft Certified Trainer MCT
Honestly, your so awesome @PowerAddict . That’s it for me! Thanks so much again!! 😁😁
Hahha I’m so sorry, really this is the last thing. Is there a way to send it to the user who is using the app? So I have it sending it to someone specific but if I want the user to send it to himself , how do I do that? Thank you!!!!
User | Count |
---|---|
254 | |
106 | |
92 | |
47 | |
37 |