Hi,
I'm attempting to add an image to a SharePoint image column using "Send an HTTP request to SharePoint" in my flow (image below). The flow runs and reports as successful, however the image doesn't get added to the column and when I check the flow results I can see an error in the Outputs - "ErrorMessage": "Unexpected character encountered while parsing value: h. Path '', line 0, position 0."
I'm not sure where the error is occurring. I've tried using different images from different places, but other than that I'm not sure what else to try to fix it. Is anyone able to help me pinpoint where the error is happening?
The error message is in the Outputs section of the flow run monitor. Here is the everything in that section:
{
"d": {
"ValidateUpdateListItem": {
"__metadata": {
"type": "Collection(SP.ListItemFormUpdateValue)"
},
"results": [
{
"ErrorCode": 0,
"ErrorMessage": "Unexpected character encountered while parsing value: h. Path '', line 0, position 0.",
"FieldName": "ImageRep",
"FieldValue": "https://xxx.sharepoint.com/sites/O365_BRA_50030345/ScIDResources/1/thumbnail.jpg",
"HasException": true,
"ItemId": 1
}
]
}
}
}
Thanks @Expiscornovus,
I really appreciate your reply and it has helped. I've run some tests and it is working for me.
The broader flow that I'm working on will upon creation of a new item in a SP list:
That may sound like an odd flow, and I'm open to other suggestions, but I'm working around a few constraints and this is where I've landed. Thanks again for your help.
Hi @_nerdy,
The new image column (thumbnail data type) requires you to upload a file. This is the reason why it is expecting a bit more in the field value. Are you using that column?
If so, you have two options. One upload it and use a different body in the request. The other option is to use the hyperlink or picture column instead.
For the thumbnail type column you could use json body like in the example below.
{"formValues":[{"FieldName":"ImageRep","FieldValue":"{\"type\":\"thumbnail\",\"fileName\":\"test.png\",\"nativeFile\":{},\"fieldName\":\"ImageRep\",\"serverUrl\":\"https://contoso.sharepoint.com\",\"serverRelativeUrl\":\"/sites/Test/SiteAssets/Lists/0185dc60-488d-489c-b52b-5aeb3372b7cb/test.png\",\"id\":\"943cd58e-e2c1-4e08-8d1a-dbca646d7359\"}","HasException":false,"ErrorMessage":null},{"FieldName":"ContentTypeId","FieldValue":"0x0100A0FE8CB63079B347A3728B16B059B2C6006995CAE06D28294FB524C01F1C7481C4","HasException":false,"ErrorMessage":null}],"bNewDocumentUpdate":true,"checkInComment":null}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.