0

I send a test HTTP-request to a SharePoint list to get the values of a list item. In return I got (shortened):


{
    "statusCode": 200,
    "headers": {
        "Transfer-Encoding": "chunked",
        "Vary": "Origin,Accept-Encoding",
        "X-SharePointHealthScore": "1",
        
    },
    "body": {
        "d": {
            
            "PraxisFoto": "{\"type\":\"thumbnail\",\"fileName\":\"Campus_Luftbild.jpg\",\"nativeFile\":{},\"fieldName\":\"PraxisFoto\",\"serverUrl\":\"https://sharepoint123.sharepoint.com\",\"fieldId\":\"c5c89367-f483-4433-a124-e307b51859ef\",\"serverRelativeUrl\":\"/sites/[SiteName]/SiteAssets/Lists/[ListID]/Campus_Luftbild.jpg\",\"id\":\"26eccafb-c4ea-4a6f-8675-xxxxxxx\"}",
            
        }
    }
}

Now I want to retrieve the value from serverRelativeUrl (/sites/[SiteName]/SiteAssets/Lists/[ListID]/Campus_Luftbild.jpg) located in the column PraxisFoto to get the filename for the image in an image column.

I fail to construct a HTTP-request or a compose action to get the value.

1 Answer 1

1

The value of the PraxisFoto property is a string. So you need to convert that string into an object to easily access the value of the serverRelativeUrl property. You can do this using the Initialize variable action to create an object variable and initializing it's value to the expression: json(variables('FullObject')['body']['d']['PraxisFoto'])

Note: I stored the value of the JSON object you posted in your question in a variable named FullObject. You need to replace the reference to that variable in the expression in your flow.

Initialize variable

Then you can use this expression to get the value of the serverRelativeUrl property in a Compose action: variables('BodyObject')['serverRelativeUrl']

1
  • Works very well, thank you. I just needed to remove the [body] part from the json() expression to get it work.
    – Der_Fab
    Commented Mar 8, 2022 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.