cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Show Button based on record status and user id.

I have a button on my PowerApps form that I am going to use for manager approval for records in a SharePoint list.  However when I load the form I only want the button to show if the record status is "Created"  and the Approving Manager matchs the manager logged onto the app.

I assume this would be in the OnVisible property of the screen and I have tried an IF statement to no effect.

Any help would be appreciated.

3 REPLIES 3
keathley
Advocate II
Advocate II

Hi @Anonymous ,

 

You likely need to use a property (such as Email) to accomplish this.  Try setting the "Visible" property of your button to something like:

 

If(User().Email=DataCardValue30.Selected.Email,true,false)

Where "DataCardValue30" is the name of your manager field.

 

Joey

 

 

v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

Could you please share a bit more about your app's configuration?

Could you please show a bit more your SP list?

 

I assume that there is a Status column (Single line of text type column) and a ApproverManager column (Person or Group type column) in your SP list, I have made a test on my side, please take a try with the following workaround:1.JPG

 

 

Set the Visible property of the Button control (Approve Button) to following formula:

If(DataCardValue3.Text="Created"&&DataCardValue4.Selected.Email=User().Email,true,false)

Note: The DataCardValue3 display the value of Status column, the DataCardValue4 display the value of the ApproverManager column.

 

If the Status column is a Choice type column in your SP list, please modify above formula as below:

If(DataCardValue3.Selected.Value="Created"&&DataCardValue4.Selected.Email=User().Email,true,false)

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you!  I will give that a try as soon as I am able to get back to my project.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,239)