I'm using the HTTP Request to SharePoint action to send a photo from Microsoft Forms to my SharePoint list.
I'm outputting the following __metadata for this action....
{
'__metadata': {
'type': 'SP.Data.Healthy_x0020_Recipe_x0020_Submissions_x0020_DevListItem'
},
'Photos':
{
'__metadata': {'type': 'SP.FieldUrlValue'},
'Url': 'http path to my image'
}
}
...but Power Automate is complaining and telling me that....
The type 'SP.FieldUrlValue' was found to be of kind 'Complex' instead of the expected kind 'Primitive'."
Is there something wrong with my metadata setup above? Maybe I'm missing something..? or have too much of something...?
Many many thanks for helping me solve my problem!
After you corrected me the first time, I now learned that the "Primitive type" error was relating to the column type I had in my SharePoint list. I thought this whole time I had Hyperlink or Picture as a type on my column. But it wasn't. It was Thumbnail. I went ahead and created a new column as Hyperlink or Picture, and Power Automate is loving it like McDonalds.
Many thanks!
Hi @kensley,
Can you share a screenshot or describe what type of column the Photos one is? Is it a hyperlink type like in my example below, or is it a different type?
Thanks. I tried the following....
{
"__metadata": {
"type": "SP.Data.Healthy_x0020_Recipe_x0020_Submissions_x0020_DevListItem"
},
"Photos": {
"Url": "https://....jpg",
"Description": "Tomato"
}
}
But the error is now...
{"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"An unexpected 'StartObject' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected."}}}
I wish I knew what that meant...
Hi @kensley,
I believe with an url field you need to set both the url and the description properties of that field.
Can you try something like this for the body?
In the example below ImageUrl is the name of the field. Change that with your internal field name.
{
"__metadata": {
"type": "SP.Data.Healthy_x0020_Recipe_x0020_Submissions_x0020_DevListItem"
},
"Title": "Test",
"ImageUrl": {"Url": "https://upload.wikimedia.org/wikipedia/commons/8/89/Tomato_je.jpg", "Description": "Tomato"}
}