cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amelch
Level: Powered On

Button visibility

Hello,

I would like to make a button visible only if the user of the app exsist in a particular column of a data source.  Currently I have it working by hard coding the names.

 

Button Visible property set to function:

If (User().FullName="Bob Smith"Or User().FullName="Jane Doe"Or User().FullName="John Doe",true,false)

 

The data source with names I would like to use is: Attendants

The column of full names is: Name

 

Your suggestions and tips are greatly appreciated!

Thanks!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Button visibility

Hi @amelch,

 

As @Drrickryp suggested, please first collect the needed table into a local variable, together with the User() function, so the OnVisible property of the Screen should be:

Set(UserTable, Attendants.Name);Set(CurrentUser, User())

Then for the filter to work, switch the formula as below:

If(CurrentUser.FullName in UserTable.Name, true, false)

Let me know if it works for you.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Button visibility

I believe that this will do it.

Make the OnVisble property or the screen: ClearCollect(user,Filter(Attendants,User().FullName="Bob Smith"Or User().FullName="Jane Doe"Or User().FullName="John Doe"))

Make the Visitble property of the button: If (!IsEmpty(user),true,false)

Rick72
Level 10

Re: Button visibility

Community Support Team
Community Support Team

Re: Button visibility

Hi @amelch,

 

As @Drrickryp suggested, please first collect the needed table into a local variable, together with the User() function, so the OnVisible property of the Screen should be:

Set(UserTable, Attendants.Name);Set(CurrentUser, User())

Then for the filter to work, switch the formula as below:

If(CurrentUser.FullName in UserTable.Name, true, false)

Let me know if it works for you.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

amelch
Level: Powered On

Re: Button visibility

Sorry for the delay, but I had a chance to work on this some more today and it worked great!  Thanks for the help.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,600)