Skip to main content

Notifications

Community site session details

Community site session details

Session Id : LnhiSUlp5Et/LdcHjX/ZrT
Power Apps - Building Power Apps
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 28 Oct 2020 14:33:41 by 905

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.

  • mchrzanowski Profile Picture
    65 on 30 Oct 2020 at 11:42:14
    Re: Block users from accessing same screen more than once (sucesfully) on a day

    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.

  • Elitezone Profile Picture
    905 on 30 Oct 2020 at 10:11:24
    Re: Block users from accessing same screen more than once (sucesfully) on a day

    @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().

  • mchrzanowski Profile Picture
    65 on 30 Oct 2020 at 08:29:11
    Re: Block users from accessing same screen more than once (sucesfully) on a day

    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 😉

     

     

  • Elitezone Profile Picture
    905 on 30 Oct 2020 at 07:49:00
    Re: de Re: Block users from accessing same screen more than once (sucesfully) on a day

    @Anonymous 

    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.

  • Community Power Platform Member Profile Picture
    on 29 Oct 2020 at 15:31:12
    de Re: Block users from accessing same screen more than once (sucesfully) on a day

    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

     

  • Elitezone Profile Picture
    905 on 29 Oct 2020 at 12:17:06
    Re: Block users from accessing same screen more than once (sucesfully) on a day

    Anyone?

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started