Hi Super users,
I am currently working on making enhancements in my request app.
Is there a way to collect data when the - sent button is clicked.
* The number of requests sent
* The number of requests sent per request creator
Should I create a Sharepoint list?
What do you think works better?
Thank you in advance!
Solved! Go to Solution.
From your description, it sounds like you want a count that persists even after the app is closed. So, yes, a Sharepoint List is a good choice for this. You'll want to add a column for UserEmail and a column for ClicksCount. You can decide too if you want to collect these by day (add a Date-type column to the List) or if you only need a total count ever.
In the OnSelect of the button, you'll add a bit of code like this:
With({aLookup: LookUp(mySPList, UserEmail = User().Email)},
Patch(mySPList,
aLookUp,
{ClicksCount: aLookup.ClicksCount + 1}
)
)
Hope that helps,
Bryan
That's clear, thank you.
Now that I cleaned up the string and made sure that the column has the right type. I tested it, no error prompted. However, MySharepoint list remains empty.
It did not record my name as the user and the number of requests I sent.
From your description, it sounds like you want a count that persists even after the app is closed. So, yes, a Sharepoint List is a good choice for this. You'll want to add a column for UserEmail and a column for ClicksCount. You can decide too if you want to collect these by day (add a Date-type column to the List) or if you only need a total count ever.
In the OnSelect of the button, you'll add a bit of code like this:
With({aLookup: LookUp(mySPList, UserEmail = User().Email)},
Patch(mySPList,
aLookUp,
{ClicksCount: aLookup.ClicksCount + 1}
)
)
Hope that helps,
Bryan
Thank you Bryan, I tried the solution you sent.
Any idea why I'm getting a squiggly line under the UserEmail 🙄?
Without seeing the error message itself, my first guess is that UserEmail isn't a column in the 'SENT REQUEST_TRACKER' table. If you have another suitable column in there, please substitute that column name instead.
If it is something else, please share the exact error message.
Bryan
If the column is named User Name (with a space between the words), then the name must be enclosed in single quotes, e.g. 'User Name'. Right now, Power Apps thinks you are referring to two separate columns, one named User and one named Name.
Also, if you are expecting names, and not email addresses, of users in that column, please substitute User().FullName for User().Email in the expression.
That's clear, thank you.
Now that I cleaned up the string and made sure that the column has the right type. I tested it, no error prompted. However, MySharepoint list remains empty.
It did not record my name as the user and the number of requests I sent.
Now I know what went wrong 😁
Thank you Bryan, your suggestion works!
Hi, Followup question though
1. Is it possible to reset the count when a new week starts?
I'm still trying to figure out the right syntax to show week number instead of date.
@Anonymous wrote:
Hi, Followup question though
1. Is it possible to reset the count when a new week starts?
I'm still trying to figure out the right syntax to show week number instead of date.
Yes, you can reset the count once each week. My recommendation is that you do it with a Power Automate flow so it happens each week no matter when you use your app. The friendly folks on the related Power Automate community forum can help you set that up.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
193 | |
45 | |
45 | |
43 | |
35 |
User | Count |
---|---|
270 | |
81 | |
80 | |
73 | |
69 |