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.
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.
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
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Top Community Contributors for September  2019

Top Community Contributors for September 2019 🎉🎉

Let's thank our top community contributors

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 445 members 5,981 guests
Please welcome our newest community members: