Tuesday, December 28, 2021

Get User Permissions From SharePoint Group In PowerApps: Part 5

 Hello Friends.

Welcome back in the User Permissions series. In previous post, we had fetched SharePoint Group name, Permissions and Users. Links of past 4 posts are-

  1. Get User Permissions From SharePoint Group In PowerApps: Part 1
  2. Get User Permissions From SharePoint Group In PowerApps: Part 2
  3. Get User Permissions From SharePoint Group In PowerApps: Part 3
  4. Get User Permissions From SharePoint Group In PowerApps: Part 4
This is the last post of this series. In this post, we will process the output of Users and apply for each loop to check if the requested user is present in the group. If present, save the group permission details.
Let's start-
  1. Add a Condition action after the Parse Users action and name it Check User Match. Now, as the data may be case sensitive hence we will use toLower function.

  2. Now choose the UserPrincipalName in left input box. The moment, you choose it, an additional Apply to each action is applied to this condition action. This is because there could be multiple users. Rename this action as For Each User.

  3. Now we will re apply the condition (Check User Match) input values by applying toLower function.
  4. Now come to If Yes condition. Here we will add "Append to string variable" action and save the name of the permission name (Full control / Contribute ...) and other stuff from RoleDefinitionBindings to strUserPermissions variable.
  5. Now the moment we will add the "Name" field from "Parse_RoleDefinitionBindings", it will add a "Apply to each" action wrapper upon this Append action.


  6. Rename this "Apply to each" to "For Each RoleDefinitionBindings".
  7.  
  8. Add a delimiter at the end of value.
  9. You may add multiple information values separated by a Data Delimiter (semicolon here) and a Row Delimiter (Hash here)
  10. Now the last step is to send this data as output response back to PowerApps. For this, collapse all the actions and it will looks like-
  11. Add new action "Respond to a PowerApp or flow'-
  12. Then click on Text output type-
  13. Give the output title as "Response" or whatever you wish. It will provide you the output in PowerApps and value as "strUserPermissions"

  14. This way, it completes the flow and this series as well.
  15. In PowerApps, you need to split data based on delimiters and use accordingly.
  16. You may visit below URL to do the same-
  17. PowerApps: Convert Delimiter String To Collection Using Ungroup And ForAll
With this, I am concluding this post.
Happy Coding !!!
Will see you again with some new topics.

Stay Safe !
Stay Healthy !

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.