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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Disable Submit button ...
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.

Categories:
I have the same question (0)
  • AldenKnibbs Profile Picture
    107 on at

    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.

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    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!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard