cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Filtering Drop-down

Hi everyone,

 

I am trying to implement some security on a drop-down box. The drop-down's data source is a table in the CDS. I would like it so that users are only able to select their own name from the list but a supervisor is able to select everyone. 

 

Is anyone able to point me in the right direction to do this?

 

Kind regards,

 

Matt

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Am assuming that Username in the CDS Table is the same as in User().FullName

I lso believe you have a column in the table for positions. 

Having said that;

1. Create a variables OnStart of the App;

 

Set(LoggedUser,User().FullName);

Set(LogedPosition, LookUp(TableName, UserNameColumnn= LoggedUser, PositionColumn)

 

2. Then filter the Dropdown Item property as;

If(LogedPosition = "Supervisor", TableName,

Filter (TableName,UserNameColumn = LoggedUser))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

1 REPLY 1
Super User III
Super User III

Am assuming that Username in the CDS Table is the same as in User().FullName

I lso believe you have a column in the table for positions. 

Having said that;

1. Create a variables OnStart of the App;

 

Set(LoggedUser,User().FullName);

Set(LogedPosition, LookUp(TableName, UserNameColumnn= LoggedUser, PositionColumn)

 

2. Then filter the Dropdown Item property as;

If(LogedPosition = "Supervisor", TableName,

Filter (TableName,UserNameColumn = LoggedUser))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (52,540)