cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elitezone
Post Prodigy
Post Prodigy

Block users from accessing same screen more than once (sucesfully) on a day

Hello,

 

I need a solution for my app.

My users are sending forms daily and I want to prevent them sending it more than once. 

I'd like to make that by blocking button access to the screen if user was already there.

 

Do you guys have any idea?

I tried to make some variable but I have no idea how to reset them at midnight.

6 REPLIES 6
Elitezone
Post Prodigy
Post Prodigy

Anyone?

Is there any formula to reset variable daily or something like that?

aurelo
Frequent Visitor

Bonjour,

Une solution pourrait être de créer une table dans laquelle vous enregistrez le nom d'utilisateur, l'écran, la dernière date d'utilisation.

Il suffira ensuite de tester la date avec la date du jour pour autoriser ou interdire le bouton correspondant

 

@aurelo 

I am using Sharepoint list as a data source.

You mean I should create a new list, and in patch function save date and name of user that submitted a form.

Then I make a validation if he made such a thing Today() and if yes block buttons?

 

I will try to do this, but I'm not really great in Patch() functions.

mchrzanowski
Frequent Visitor

Hello,

 

In one of my apps I wanted to do similar thing. Easiest way I found was something like that:

 

-In my menu, I added to onSelect :

If( IsEmpty( Filter( Status, Created >= Today(), Title = User().FullName ) ), Set( StatusCheck, true ), Set( StatusCheck, false )

Which basicly checks if given user added a record today ( Status is my sharepoint list DataSource, in Title I store user fullname, but you can use anything, as long as it is unique identifier).

 

-Then set form and button visibility to StatusCheck, then added label with visiblity !StatusCheck, which informed user that he already provided this info today.

 

If you need any futher explanation let me now 😉

 

 

@mchrzanowski 

Seems to be working.

 

If(IsEmpty( Filter( WhoIsThere, Created >= Today(), 'Email storage'.Email = User().Email ) ),Navigate(Screen5_JobisDone,None),Notify("You cannot do that again!.",NotificationType.Error))

I changed it to allow to Navigate and show error message.

Looks good. 

 

I will have to check tommorow if this works, but the real test would be on 23.59...

I have a lot of bad experiance with Today().

You have to restart app in order to re-set value of Today(), since it's being assigned probably somewhere around launching - this is my observation. Also, if you are using proxy, timezones might not be correct, so it can be different hour than midnight.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (18,413)