Intranetbee is a #No.1 SharePoint intranet portal

JOIN OVER 3,000

Subscribers who get fresh content to help their business weekly...

Categories
Categories

Nowadays many project managers On-board people to the project and off-board them once the project is successfully completed. Here the scenario is each and every time a resource is on-boarded to a project , project manager has to provide the resource with all the On- boarding checklist , access details and point of contact details over the mail which indeed take some amount of time so this article will help the project manager to create list item with the on boarding details like name of the resource and process type(On-board /Off-board) and respective point of contact details. Once this item is created in a SharePoint list a power automate flow will trigger which adds the resource to the member group of the SharePoint site as well as the receives a welcome email with all the necessary details for the project vice verse for off-boarding as well.

1.Creation of SharePoint list

Create a SharePoint list with the below fields extra fields can be added as per your requirements,

Note – PointOfContacts field allows multiple user selection
Process type has two choice fields as mentioned below

We can create a flow by directly opening Power Automate (https://powerautomate.com/ ) or directly opening from the list / library.
To open from the list/library select the Automate option from the ribbon → Create a flow

Once you click on create a flow a small box open in the right side ,scroll down and click more it redirects to the flow page

from New select the template Automated-from the blank
Step 1 – Select the action “ when an item is created “ Select the site address , list name and the view name from the drop down.

Step 2 – Initialize the variable for the point of contact names.

Step 3– Append to the array variable to store the collection of values. Since the value is a collection it automatically goes inside and applies to each block.

Step 4 – To join the array values use join action with the value as “,” (Comma) which separate each of the array values.

Step 5 – Choose the conditional block to check if the “Process Type“ is equal to “on-boarding” or not.

Step 6 – If the conditional block matches it goes to the “Yes” block and gets the resource names from the SharePoint list using “Send HTTP request to SharePoint” action.
Uri – “_api/web/SiteUsers/getbyemail(“Select the resource name field from the dynamic content”).

Method – Get

Headers – Accept, application/json;odata=nometadata
Repeat the same in the “No” block as well.

Step 7 – Now the resources needs to be added to the sharepoint member group, to do so select the action “Send HTTP request to SharePoint”.

Uri – “__api/web/sitegroups(6)/users”

Note – “6” is the ID of the SharePoint member group which remains the same for all the site SharePoint site.

Method – POST

Headers – Accept, application/json; odata.metadata=none ,
Content -Type = application/json

Body – Use the login names of the user {
‘LoginName’:’@{triggerBody()?[‘ResourceName’]?[‘Claims’]}’
}
Once this block executes the resource will be added to the members group.

Step 8 – In the “No” block, perform delete activity (for off-boarding) to do so select “Send HTTP request to SharePoint”

Uri – _api/web/sitegroups(6)/users/getbyemail(Select the resource name field from the dynamic content.

Headers – Content -Type = application/json,

IF-MATCH – *,

X-HTTP-Method – DELETE,

Body – Use the login names of the user {
‘LoginName’:’@{triggerBody()?[‘ResourceName’]?[‘Claims’]}’
}
Once this block executes the resource will be removed from the members group.

Step 9 – Select “Send email block” for sending On-boarding welcome email message along with the necessary details vice verse this can be done for Off-boarding as well if necessary and it is based on the requirements

To – Resource Name Field

Leave a Reply

Your email address will not be published. Required fields are marked *