Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Disable Submit button if data in Sharepoint list matches conditions

(0) ShareShare
ReportReport
Posted on by 21

I would like to disable the submit button on an app if in a connected sharepoint list, the author email is found and the active column is set to true.

  • Verified answer
    LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on at
    Re: Disable Submit button if data in Sharepoint list matches conditions

    Hi @pw212,

     

    You could use the following code in the DisplayMode property of that button. You will have to adjust the list name & column names accordingly.

    If(
     IsBlank(
     LookUp(
     ListName,
     //Should you have a text column use: TextColumn = User().Email
     //Should Active column be text use: ActiveColumn = "true"
     PersonColumn.Email = User().Email && ActiveColumn
     )
     ),
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • AldenKnibbs Profile Picture
    107 on at
    Re: Disable Submit button if data in Sharepoint list matches conditions

    To disable the submit button in your Power Apps canvas app based on specific conditions in a connected SharePoint list, you will need to follow these steps. This process involves fetching the SharePoint list item based on the author email and checking the value of the "active" column. Here's how you can accomplish this:

    1. Ensure Your SharePoint List Connection: First, make sure you have added your SharePoint list as a data source in your Power Apps canvas app.
    2. Use the LookUp Function: You can use the LookUp function to search the SharePoint list for an item that matches the author's email and where the "active" column is set to true.
    3. Disable the Submit Button: Set the button's DisplayMode property to conditionally disable it based on the result of the LookUp function.

    Here is a step-by-step guide:

    Step 1: Add SharePoint List as Data Source

    • In your Power Apps canvas app, go to "Data" on the left-hand side panel, click "Add data," and select your SharePoint list. Let's assume your list is named "AuthorsList" for this example.

    Step 2: Write the Formula for the Button's DisplayMode Property

    • Select the submit button in your app.
    • In the formula bar, set the DisplayMode property of the button to something like the following:
    If(
     IsBlank(
     LookUp(
     AuthorsList, 
     AuthorEmail = User().Email && Active = true
     )
     ), 
     DisplayMode.Edit, 
     DisplayMode.Disabled
    )

    Explanation:

    • LookUp(AuthorsList, AuthorEmail = User().Email && Active = true): This part checks the "AuthorsList" for an item where the "AuthorEmail" column matches the current user's email (assuming User().Email retrieves the current user's email) and the "Active" column is true.
    • IsBlank(...): This checks if the LookUp function found any item. If it returns true, it means no item was found where the author's email matches and is active, hence the condition to decide if the button should be disabled.
    • DisplayMode.Edit means the button is enabled, and DisplayMode.Disabled means the button is disabled.

    By using this formula, the submit button will be disabled if there's an item in the "AuthorsList" where the "AuthorEmail" matches the current user's email and the "Active" column is set to true. Otherwise, the button will be enabled.

     

    This approach assumes that the "AuthorEmail" and "Active" are the correct internal names of your columns in SharePoint. Ensure to replace them with the actual internal names of your columns. Also, this formula uses User().Email to get the current user's email, ensure this matches how your app is set up to identify users.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 770 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 494

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 399