3

In Power Automate I am calling an API which returns this JSON:

    {
   "status":"200",
   "Suburbs":[
      {
         "ID":"1000",
         "Name":"CONCORD WEST",
         "Postcode":"2138"
      },
      {
         "ID":"1001",
         "Name":"LIBERTY GROVE",
         "Postcode":"2138"
      },
      {
         "ID":"1002",
         "Name":"RHODES",
         "Postcode":"2138"
      },
      {
         "ID":"3891",
         "Name":"UHRS POINT",
         "Postcode":"2138"
      },
      {
         "ID":"1003",
         "Name":"YARALLA",
         "Postcode":"2138"
      }
   ]
}

Using PA actions, how do I convert this JSON to a String variable that looks like this?: "CONCORD WEST, LIBERTY GROVE, RHODES, UHRS POINT, YARALLA"

0

1 Answer 1

2

I figured out how to do this. I prefer not to use complex code-style expressions in Power Automate flows as I think they are hard to understand and hard to maintain so used standard PA actions where I could.

I parsed the JSON, then used "Select" to pick out the suburb names, then used concat() within a "for each" loop through the Suburbs array. I think that Compose could probably be used in the place of the concat() but stopped investigating once I'd found this solution.

Parse JSON, select then for each

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.