cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
msmith
Level 8

Display Field Based on User

I successfully managed to filter the browser gallery by logged on user with this community's help using the follow.

 

 SortByColumns(Filter('Training Check List',Office365Users.MyProfile().DisplayName=Officer.DisplayName),"Title",If(SortDescending1,Descending,Ascending))

How can I do a conditional format on a "Card" or "Field" to hide it? I have 4 or 5 supervisors that will be creating an item that need access to a certain field, but everyone else should not see it or at the very least make it read only. Is that possible. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Display Field Based on User

Hi @msmith,

 

Yes, this could be done.

You could change the Visible property of the corresponding DataCard with the code below:

If(User().FullName="UserFulName",true, false)

Or in the following format:

If(User().FullName in ["User Name 1", "User Name 2",....],true, false)

The code would check if the UserName matches the one specified, or within the User Name table, if yes, show the DataCard, otherwise, this data card would be invisible.

By the way, you should also replace

User().FullName

with 

Office365Users.MyProfile().DisplayName

 

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

KarlHoffmaster
Level: Powered On

Re: Display Field Based on User

Another method would be to use the "DisplayMode" property.  If you use "DisplayMode.Edit", the user can view and update the field.  If you use "DisplayMode.View", the user can only view the field and it will not appear grayed out.  If you use "DisplayMode.Disabled", the field will not be able to updated and will appear grayed out.

 

Example:  If(UserName = "Supervisor Name", DisplayMode.Edit, DisplayMode.View)

Confluent

View solution in original post

5 REPLIES 5
Rebetcha
Level 10

Re: Display Field Based on User

Could you explain a bit more of the scenario when you want to hide what?
msmith
Level 8

Re: Display Field Based on User

I have it setup so the number of people will equal how many sign up spots there are. What I do not want is for people to be able to change the number of people. The only people that should be able to change this is the supervisor.

 

PowerAppCapture.jpg

Community Support Team
Community Support Team

Re: Display Field Based on User

Hi @msmith,

 

Yes, this could be done.

You could change the Visible property of the corresponding DataCard with the code below:

If(User().FullName="UserFulName",true, false)

Or in the following format:

If(User().FullName in ["User Name 1", "User Name 2",....],true, false)

The code would check if the UserName matches the one specified, or within the User Name table, if yes, show the DataCard, otherwise, this data card would be invisible.

By the way, you should also replace

User().FullName

with 

Office365Users.MyProfile().DisplayName

 

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

KarlHoffmaster
Level: Powered On

Re: Display Field Based on User

Another method would be to use the "DisplayMode" property.  If you use "DisplayMode.Edit", the user can view and update the field.  If you use "DisplayMode.View", the user can only view the field and it will not appear grayed out.  If you use "DisplayMode.Disabled", the field will not be able to updated and will appear grayed out.

 

Example:  If(UserName = "Supervisor Name", DisplayMode.Edit, DisplayMode.View)

Confluent

View solution in original post

msmith
Level 8

Re: Display Field Based on User

Both worked for me, fantasic! Thank you!

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 (6,403)