Post image to Sharepoint List using Http request

106 Views Asked by At

I have the following image in a SharePoint library:

enter image description here

I wish to Insert this image into an Image Column as part of the metadata of a List called QSAR Analysis Data.

enter image description here

TEST Flow to try and achieve this I run into all sorts of errors:

Based on: https://ganeshsanapblogs.wordpress.com/2022/10/08/add-an-image-to-sharepoint-image-columns-using-power-automate/

enter image description here

Note the title should really say TEST but this is an old screenshot and for testing I don't mind which item the image were to join.

However, I get the following error:

The property '__metadata' does not exist on type 'SP.Data.QSAR_x0020_Analysis_x0020_DataListItem'. Make sure to only use property names that are defined by the type.
clientRequestId: 87870979-e145-4342-86c3-093dbbf32f26
serviceRequestId: d4e810a1-5019-8000-54bf-d6b1c5f76cb2

Removing this I then get another error:

The property 'type' does not exist on type 'SP.Data.QSAR_x0020_Analysis_x0020_DataListItem'. Make sure to only use property names that are defined by the type.
clientRequestId: 10825d98-ac88-419a-a5c0-10123d487802
serviceRequestId: 0fe910a1-f029-8000-2b56-b40b4ec74d91

Removing this line gives me:

{
    "Title": "TEST",
    "Image": {
        "type": "thumbnail",
        "fileName": "TEST.png",
        "fieldName": "Image",
        "serverUrl": "https://xxx.sharepoint.com/",
        "serverRelativeUrl": "/sites/xxx/ImageTest/Images/TEST.png"
    }
}

But running this I get the following error:

An unexpected 'StartObject' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected.
clientRequestId: e6590f4e-1a8a-4256-a6ac-8fc26a3bf1e6
serviceRequestId: 24e910a1-503d-8000-3403-c857782bfc69

So I'm clearly just digging myself a hole.

TO GET IMAGE AVAILABLE IN POWERAPPS

enter image description here

1

There are 1 best solutions below

0
Nick On

Solution:

enter image description here

Note I used Branch List which is trying to exactly mimic a video.

If you get a metadata issue, it is because you need the additional headers and need to specify the item you wish to modify using ID.