2

How do I extract the content of my request that's been received inside of the logic app?

I've got a regular http-triggered logic app, like so:

enter image description here

I'm sending it a POST request through postman like so:

enter image description here

{
    "$content-type": "application/octet-stream",
    "$content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><cases><file-path>yes</file-path></cases>"
}

I'm attempting to extract the $content payload:

"@{string(xml(string(triggerBody()?['content'])))}"

The issue I am getting is:

enter image description here

How do I extract the content of my request that's been received inside of the logic app?

Here's the entire initialize variable step:

    "Initialize_variable": {
        "inputs": {
            "variables": [
                {
                    "name": "contentOfRequest",
                    "type": "String",
                    "value": "@{string(xml(string(triggerBody()?['content'])))}"
                }
            ]
        },
        "runAfter": {},
        "type": "InitializeVariable"
    }
0

1 Answer 1

1

Cause the request body is string, it doesn't support select property. so you need parse it Json format firstly, then you will be able to select $content.

enter image description here

About how to get the Json Schema, just click the Use sample payload to generate schema in the Parse Json action and paste your Json data, then click the done.

And then extract the $content value with body('Parse_JSON')?['$content'], in this way you will get the content value.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.