
I'm struggling trying to build a flow to update a hyperlinks column (format picture) with an employee photo from Office 365. Please see the photos below for my current set up. I keep getting this error message: The request ETag value '' does not match the object's ETag value '"3681986c-bd79-4320-a740-10720f93c9c8,2"'.
clientRequestId: 89a6df56-1421-44c3-b05e-4c9e3caa32e1
serviceRequestId: a5a105a1-1098-4000-d3e8-d34e8ba76f79
Any help will be greatly appreciated!
Here is the sample flow.
In this example, I have used custom SharePoint list "Employee" where Title contains the email address of the users and "EmpPhoto" is the hyper link where photo URL will be saved.
Add Compose action to store the URL of SharePoint site collection. Post that add "Get items" action to fetch list items from Employee list:
Next, add "Apply to each" action and pass the value object from get items as its input. Inside apply to each, add "Send an http request to SharePoint" action to update the URL of hyperlink column in SP list:
Site Address: <<SharePoint site collection URL>>
Method: POST
Uri: _api/web/lists/GetByTitle('Employee')/items(@{items('Apply_to_each')?['ID']})
Headers:
| Content-Type | application/json;odata=verbose |
| X-HTTP-Method | MERGE |
| IF-MATCH | * |
Body:
{
"__metadata": {
"type": "SP.Data.EmployeeListItem"
},
"EmpPhoto": {
"Description": "@{items('Apply_to_each')?['Title']}",
"Url": "@{outputs('Compose')}/_layouts/15/UserPhoto.aspx?Size=L&AccountName=@{items('Apply_to_each')?['Title']}"
}
}
basically, we are using SharePoint userphoto.aspx page to get the URL of the pic which is in the format:
<<SharePoint site collection URL>>//_layouts/15/UserPhoto.aspx?Size=L&AccountName=<<email address of the user>>
Another approach is to use "Get user photo" action to get the content bytes of pic and saves it in SharePoint library. The path of the user pics from SharePoint library will be passed in the http request for updating the hyperlink column.
Flow Output:
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.