0
    {
      "Query": {
        "inputs": {
          "headers": {
            "Content-Type": "application/json"
          },
          "method": "GET",
          "queries": {
            "f": "json",
            "temp": "\"test\": @json(body('http'))['candidates'][0]['location']['x']"
          },
          "uri": "https://testurl.com/restApi"
        },
        "runAfter": {

        },
        "type": "Http"
      }
    }

It reads "temp" as "test" : @json(body('http'))['candidates'][0]['location']['x']"

If I change this line to

    "temp": "@json(body('http'))['candidates'][0]['location']['x']"

It read the correct value from json. Not sure if its a bug, or I am missing some syntax.

2 Answers 2

3

You may try what Steven answered (https://stackoverflow.com/a/44062649/7997843) or this which is more explicit to me:

"temp": "@concat('\"test\":', json(body('http'))['candidates'][0]['location']['x'])"

I suggest you to read about string interpolation in the workflow definition language here: https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language#Expressions

Your case seems to be a limit case. Either you begin your expression with @ ou @{ and then the name of your function or you can begin with a string but then you won't have any choice but to use @{

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

Comments

2

Can you try with the following syntax:

"temp": "\"test\": @{json(body('http'))['candidates'][0]['location']['x']}"

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.