cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HarishaAkkil
Helper III
Helper III

Disable/Greyout value in drop down SharePoint list based on Logged in user.

Hi Team,

 

I have a SharePoint list, with column of choice type have values - A, B, C, D, E, F.

 

Now, I have user who belongs to COE group (SharePoint group) who has edit permission assigned to the list, while creating an item or editing an item he should be able to view all the values.

 

And if the user does not belong that group, he should be able to choose only A, B, and C values while creating or editing the item.

 

Is it possible to do so?

 

Regards,

Harisha

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @HarishaAkkil ,

 

It's not easy to check if the user exist in the sharepoint group, but finally I manage to achieve it.

The solution is to use 'Send HTTP Request to SharePoint' action with GET method via MS Flow to retrieve all SharePoint Group users.

Here is Overview of the Flow:

Snipaste_2020-06-03_14-29-26.pngSnipaste_2020-06-03_14-31-42.png

In PowerApps, Call the flow in App.OnStart property, and set the output to variable.

App.OnStart: Set(GroupUsers,UsersFromSPGroup0603.Run().users)

 

The output of flow to PowerApps is a string with all users separated by comma shown as follows.

Snipaste_2020-06-03_14-37-55.png

At last, we just need to modify the Items property of combobox as follows:

If(Lower(User().Email) in Lower(GroupUsers),Choices('SP list'.ChoicesColumn),Filter(Choices('SP list'.ChoicesColumn),Value = "A" || Value = "B"||Value = "C"))

Snipaste_2020-06-03_14-45-25.png

Hope this helps.

Sik

 

View solution in original post

4 REPLIES 4
v-siky-msft
Community Support
Community Support

Hi @HarishaAkkil ,

 

It's not easy to check if the user exist in the sharepoint group, but finally I manage to achieve it.

The solution is to use 'Send HTTP Request to SharePoint' action with GET method via MS Flow to retrieve all SharePoint Group users.

Here is Overview of the Flow:

Snipaste_2020-06-03_14-29-26.pngSnipaste_2020-06-03_14-31-42.png

In PowerApps, Call the flow in App.OnStart property, and set the output to variable.

App.OnStart: Set(GroupUsers,UsersFromSPGroup0603.Run().users)

 

The output of flow to PowerApps is a string with all users separated by comma shown as follows.

Snipaste_2020-06-03_14-37-55.png

At last, we just need to modify the Items property of combobox as follows:

If(Lower(User().Email) in Lower(GroupUsers),Choices('SP list'.ChoicesColumn),Filter(Choices('SP list'.ChoicesColumn),Value = "A" || Value = "B"||Value = "C"))

Snipaste_2020-06-03_14-45-25.png

Hope this helps.

Sik

 

Hi @v-siky-msft ,

 

Thanks for the solution.

Hi @HarishaAkkil ,

 

Does it make sense for your case?

Sik

Hi @v-siky-msft ,

 

It does.

 

Thank you,

Harisha

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,446)