cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
datalearner
Frequent Visitor

Restricting Dropdown items for users

Hi Community,

Is it possible to allow a specific user to see all items of a dropdown (example below) but prevent him from selecting specific items (Such Step1, Step2 and Step3)

datalearner_0-1634917988623.png

Any suggestion or help would be appreciated. 

 

4 REPLIES 4
StalinPonnusamy
Community Champion
Community Champion

Hi @datalearner 

 

In a very simple case, we can hardcode by setting Items property of dropdown to 

 

If(RestrictedUserCondition, ["Step1","Step4"],["Step1", "Step2","Step3", "Step4"])

 

 

If the List gets from Sharepoint or Any other data source then

 

Filter the list when the page Onvisible

ClearCollect(
    AllStatuses,
    Choices(SPList.ChoiceColumn)
);
If(
    User().Email in (Concat(SPList.PersonColumn,PersonColumn.Email &",")),
    RemoveIf(
        AllStatuses,
        (Value = "New" || Value = "Completed") //New and Completed will be removed
    )
)

Sample

 

ClearCollect(
    AllStatuses,
    Choices(IssueTracker.Status)
);
If(
    User().Email in (Concat(IssueTracker.'Assigned to','Assigned to'.Email &",")),
    RemoveIf(
        AllStatuses,
        (Value = "New" || Value = "Completed")
    )
)

 

 

Now Collection "AllStatuses" has restricted based on the user list which can be defined in Sharepoint

Set the Items property of dropdown to

 

AllStatuses

 

 

Hi @StalinPonnusamy 

Thank you for the answer.

The suggested solution would either remove or list the item in the dropdown depending on the connected user,

Would it be able to list all items whoever was connected and apply the restriction on the selection, for example User1 would see all items but should not be able to select some, is it possible to do this in Power Apps?

 

Thank you in advance. 

StalinPonnusamy
Community Champion
Community Champion

Hi @datalearner 

 

There is no option to disable the specific option selection based on condition. But other possible options are We need to validate whether the selected option is valid once the user is selected either the OnChange event or the On Save event.


Thanks,
Stalin - Learn To Illuminate

 

StalinPonnusamy
Community Champion
Community Champion

Hi @datalearner 


Please let us know if anything needs on your post. We can help with this.

Please mark the post as Solved If I have answered your question.
Please give it a Thumbs Up if you find the suggestion helpful

Thanks,
Stalin - Learn To Illuminate

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,679)