The flow to get and update the user profile property is as follows.
- Create a trigger to fire the flow whenever an item is created.
- Create a SharePoint action “Send an HTTP request to SharePoint”, to get the user profile property details as explained in the article mentioned above.
- Parse JSON data to get the exact required property (user display name).
- Update the same item with author name field with the value retrieved.
The following steps shows how to configure the flow to handle the error and configuring appropriate send email action.
- Just after the “Send an HTTP request to SharePoint” action, add a parallel branch with an action.
|Breaking the existing Flow and Adding Parallel Condition for Error Actions|
- In the parallel branch, add an “Send an email” action. In the action provide the necessary details like, email address, subject and body text.
|Setting Send an email option inputs to send error details|
- From send an email action, click on more option (three dots). Select "Configure run after" option.
|Clicking configure option for send an email action|
- Configure the action to run once the "send an http request" action fails, as shown below. This is done be selecting has failed check box for the previous action. Click on done once configured.
|"Configure run after" being set on Email Action to "has failed" for HTTP request action|
- Parallely parse JSON will have configure option set to "is successful".
|Flow showing two parallel actions. On the left success action and on the right failed action being configured.|
Test the Flow for Error Handling:
|Flow Snapshot showing the error handling and email alert being sent|