Microsoft Flow is a cloud-based software that allows automating tasks across multiple applications.
SharePoint REST API exposes an API which gives information about users, lists, doc libs, permissions in SharePoint. This solely depends on the API we are calling from SharePoint. The result obtained can then be manipulated and used for further functionalities.
In the below steps, we will learn how to integrate MS flows with the SharePoint REST API.
Let’s take a scenario
We have a SharePoint List. On entering a specific item to the list, SharePoint searches whether the user who entered the item is an Admin or not. The Admin users are present in a specific group “RequestAdmin”.The flow then sends an email to the user notifying them whether they are admins or not.
First, let’s create a SharePoint group and create a group named Request Admins. Then, add a few members to it.
While creating the group, we need to follow the below step so that people accessing the flow will be able to retrieve the members from the SharePoint group.
Now, let’s start with the flow.
- We choose SharePoint and then the action as “When list item is created”,
Site Name:FinanceTeam
ListName:PowerAppAdmin

- We assign 2 variables “IsAdministrator” to check whether the person is an admin or not, next “UserGroupInfo” to get the details of the users in the specific group. The “initialize variable” expression is used to achieve the purpose in FLOW.

- Then, we call the SharePoint REST API method on SharePoint group to get the details of the users.
The URI parameter should be given as follows.
/_api/web/sitegroups/getByName('RequestAdmin')/Users?$filter=Email eq 'Email Id of the user entering the list item."}]}
Let’s rename this step as “CheckUserGroup” which will be used later.







Neeraj SinghPosted Jun 26, 2019, 12:35 PM
Nice article