Tuesday, December 28, 2021

Get User Permissions From SharePoint Group In PowerApps: Part 2

Hello Friends,
Welcome back in the User Permissions series. In last post (Part 1) we have created a list, SharePoint Groups, added users to these groups, broke inheritance of list permissions, assigned unique permissions. You may use below link to visit the post-
  1. Get User Permissions From SharePoint Group In PowerApps: Part 1
In this Part, we will create an Instant cloud flow (of type PowerApps) and then we will initialize some variables in that flow.
So, let's start-
  1. Click on App Launcher icon provided at top left corner and click on Power Automate.
  2. It will open the Power Automate maker portal. Click on "+ Create" and then choose "Instant cloud flow".
  3. It will open a popup, where you need to input the flow name.
  4. Then choose flow type as PowerApps, then click on Create button to create the flow.
  5. Now click on Save to initially save the flow. Once saved this way, will not let you down in case of any accidental crash. Now, further you need to just click on Save to save the flow any time.
  6. Now, we need to input variables-
    1. User EMail ID
    2. List Name
  7. These values will be provided from PowerApps and we will process here in flow. So, add a Compose action and rename it "Compose ListName". For Input value, we will select "Ask in PowerApps" as shown in below screenshot-

  8. Similarly, add another compose action to get UserEMail as input-
  9. Click on Save icon to save our changes. We will save the flow frequently.
  10. Now we will initialize a string variable "strUserPermissions" using "Initialize variable" action. This variable will store a concatenated string of all Permissions, Permission Groups assigned to user upon the list name provided.
  11. Now we will initialize an integer variable "intPrincipalId" using "Initialize variable" action. It will be used to capture the PrincipalId of the group (basically it is the MembershipGroupId which we see in URL when we click on any SharePoint group). Initialize it with ZERO initially.
  12. Now we will initialize another string variable "strSharePointGroupName" using "Initialize variable" action. It will be used to capture the SharePoint Group name. We will get this information from Member Title.
  13. This completes the Part 2. In Part 3, we will send HTTP request to get RoleAssignments (list permissions) applied upon the list and then we will parse it to get it readable.
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.