web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Validate User email an...
Power Apps
Unanswered

Validate User email and can only submit once a week

(0) ShareShare
ReportReport
Posted on by 100

Hi Guys,

 

Need your guy's expertise, there's 1 button where I need to validate based on display mode where user can only click once a week.

 

The validation should only come from user email address and can click only once a week. 

 

Much appreciated you guys' support.

 

TIA😁

Categories:
  • Haki500 Profile Picture
    100 on at

    Sorry and the databased is from Sharepoint List

  • VishalJhaveri Profile Picture
    1,169 Moderator on at

    I got a Prompt Response which might help. 

     

     

    To implement a button in PowerApps that allows users to click only once a week based on their email address, you can follow these steps:

    1. Insert a Button: Insert a button control into your PowerApps app.

    2. Set the DisplayMode Property: Set the DisplayMode property of the button to a formula that checks if the user's email has clicked the button within the last week.

    3. Use Variables: Use variables to store the last clicked timestamp and the user's email address.

     

    Here's a step-by-step guide:

    1. Set up Variables: Create two variables to store the last clicked timestamp and the user's email address. You can set these variables when the app starts or when the user logs in. For example:
    ```plaintext
    Set(LastClickedTimestamp, LookUp(UserClicks, Email = User().Email).LastClicked);
    Set(UserEmail, User().Email)
    ```

    2. Button DisplayMode Property: Set the DisplayMode property of the button to a formula that checks if the current timestamp is at least one week later than the last clicked timestamp for the user's email. If it's been less than a week, disable the button. Here's an example formula:
    ```plaintext
    If(
    IsBlank(LastClickedTimestamp) || DateDiff(LastClickedTimestamp, Now(), Days) >= 7,
    DisplayMode.Edit,
    DisplayMode.View
    )
    ```

    3.OnSelect Property: In the OnSelect property of the button, add the logic to perform the desired action when the button is clicked. This could include updating the LastClickedTimestamp variable and saving the click record to a data source. Here's an example:
    ```plaintext
    If(
    DisplayMode = DisplayMode.Edit,
    // Perform desired action here
    UpdateContext({LastClickedTimestamp: Now()});
    Collect(UserClicks, {Email: UserEmail, LastClicked: Now()})
    )
    ```

    4. UserClicks Data Source: Create a data source in your app to store user clicks. This data source should have at least two columns: 'Email' and 'LastClicked'.

    Make sure to adjust the formulas and data source names according to your app's structure and requirements. This approach ensures that users can only click the button once a week based on their email address.

  • Haki500 Profile Picture
    100 on at

    Hi @VishalJhaveri 

     

    Let me try and get back to you. Is there any other alternative way based on SharePoint List?

  • VishalJhaveri Profile Picture
    1,169 Moderator on at

    You can create 2 columns Start Date, End Date.

    When the user clicks on the button for the first time, store the Start Date, End Date=Start Date+7.

    Then provide the DisplayMode functionality of the button to Disabled state when the Now() Date is greater than Start Date and less than equal to End Date().

    When the Now() is greater than End Date(), the button DisplayMode will be Enabled so the user can enter click or press the button.

     

    I hope you get what I am referring to.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard