Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article, we will see how to deal with SharePoint Online List Item update event.
For the demo in this article, we will consider a business scenario where on an update of any Product in the Product list, an approval process will execute and an email is sent to the approver for the selection of Price Range for the Product just updated.
To start with a demo we have a Product List in SharePoint Online Site as shown below
https://howtodowithsharepoint.files.wordpress.com/2017/07/29.png?w=800
Go to “Flow” Menu and click “Create a Flow”
https://howtodowithsharepoint.files.wordpress.com/2017/07/31.png?w=800
Here we have two choices: either we can use any available workflow template that suites our requirements or we can create a new one from scratch
https://howtodowithsharepoint.files.wordpress.com/2017/07/41.png?w=800
For this demo, we will create a Flow using blank template
Go to Flow Site by clicking “See you flow” links
https://howtodowithsharepoint.files.wordpress.com/2017/07/51.png?w=800
Click “Create from blank” this will launch Workflow Designer
https://howtodowithsharepoint.files.wordpress.com/2017/07/61.png?w=800
On the Workflow Designer, select the Trigger
We can select trigger from the any of the available services as shown highlighted below
https://howtodowithsharepoint.files.wordpress.com/2017/07/71.png?w=800
Select SharePoint Online as target service and select for the Trigger “SharePoint-When an existing item is modified”
https://howtodowithsharepoint.files.wordpress.com/2017/07/81.png?w=800
Provide the Title to the Workflow “Product Details Modification Approval Request”
https://howtodowithsharepoint.files.wordpress.com/2017/07/91.png?w=800
Create SharePoint context by providing Site URL and List Name as shown
https://howtodowithsharepoint.files.wordpress.com/2017/07/101.png?w=800
You can optionally rename the Step by selecting “Rename” option as shown below
https://howtodowithsharepoint.files.wordpress.com/2017/07/111.png?w=800
Here we have changed the name of Step to “Get SharePoint Context”
https://howtodowithsharepoint.files.wordpress.com/2017/07/121.png?w=800
Add another action to the workflow by clicking “Add an action” option
https://howtodowithsharepoint.files.wordpress.com/2017/07/131.png?w=800
Send email by selecting “Office 365 Outlook” Service and “Office 365 Outlook-Send approval email” action
https://howtodowithsharepoint.files.wordpress.com/2017/07/141.png?w=800
Rename the name of Step to “Request Approval”
https://howtodowithsharepoint.files.wordpress.com/2017/07/151.png?w=800
Choose or approver’s email in “To”. Here we are just selecting the email of the person who has originally created the Product in list by choosing “Created By Email” field
Specify Subject as applicable
Specify User Options that allows approver to select the approval options from within the mail
Specify the Body content as required. This content can consist of dynamic tokens provided by Workflow runtime as shown below
https://howtodowithsharepoint.files.wordpress.com/2017/07/161.png?w=800
Update List Item by selecting “SharePoint Online” Service and “SharePoint-Update item” action
https://howtodowithsharepoint.files.wordpress.com/2017/07/171.png?w=800
Rename the step to “Update item”
Specify Site URL and List Name
In Id field select “ID” token provided by workflow runtime. This token represents the List item Id of the item that triggered this workflow to execute.
It is important to note that values to all mandatory fields in the list must be provided. If you don’t want to change the values you can choose same values again.
https://howtodowithsharepoint.files.wordpress.com/2017/07/181.png?w=800
For Title field we have selected “Title” token that represents current value present in list for the Title field of this item
https://howtodowithsharepoint.files.wordpress.com/2017/07/191.png?w=800
In “Product Price Range” field choose “SelectedOption” token that will hold the value selected by the approver from within the mail
https://howtodowithsharepoint.files.wordpress.com/2017/07/201.png?w=800
Once all the Steps are configured as required we can save the workflow by clicking “Save flow”
https://howtodowithsharepoint.files.wordpress.com/2017/07/211.png?w=800
Click “Done” to return back to the workflow dashboard
https://howtodowithsharepoint.files.wordpress.com/2017/07/221.png?w=800
On the workflow dashboard, we can see the details of services used within this workflow
https://howtodowithsharepoint.files.wordpress.com/2017/07/231.png?w=800
Now modify and the Product in Product List and notice the “Product Price Range” field which is currently set to “Low”
https://howtodowithsharepoint.files.wordpress.com/2017/07/241.png?w=800
Once the Product details have been changed, this will trigger the workflow that we have developed
https://howtodowithsharepoint.files.wordpress.com/2017/07/251.png?w=800
On execution the workflow we can see a new email hitting the inbox of the approver
https://howtodowithsharepoint.files.wordpress.com/2017/07/261.png?w=800
Let’s consider the approver submitted “High” as approval option
https://howtodowithsharepoint.files.wordpress.com/2017/07/271.png?w=800
This action will update the “Product Price Range” field for the list item to “High” as shown below
https://howtodowithsharepoint.files.wordpress.com/2017/07/281.png?w=800
Hope you find it helpful.