Share via

JSON to JSON liquid transform

Ashwin Chakravarthy Kuruvidi 20 Reputation points
2020-06-10T11:15:47.29+00:00

I want to convert this:

{
  "firstName": "John",
  "lastName": "Smith",
  "fullName": "John Smith",
  "age": "32",
  "emailAddress": "******@hotmail.com",
  "dob": "1988-12-06",
  "billingAddress__streetAddress": "21 2nd Street",
  "billingAddress__city": "New York",
  "billingAddress__state": "NY",
  "billingAddress__postalCode": "10021",
  "shippingAdress__streetAddress": "21 2nd Street",
  "shippingAdress__city": "New York",
  "shippingAdress__state": "NY",
  "shippingAdress__postalCode": "10021",
  "phoneNumber": [
    {
      "type": "home",
      "number": "212 555-1234"
    },
    {
      "type": "fax",
      "number": "646 555-4567"
    },
    {
      "type": "mobile",
      "number": "212 555-1299"
    }
  ]
}

To this:

{
  "firstName": "John",
  "lastName": "Smith",
  "fullName": "John Smith",
  "age": "32",
  "emailAddress": "******@hotmail.com",
  "dob": "1988-12-06",
  "billingAddress__streetAddress": "21 2nd Street",
  "billingAddress__city": "New York",
  "billingAddress__state": "NY",
  "billingAddress__postalCode": "10021",
  "shippingAdress__streetAddress": "21 2nd Street",
  "shippingAdress__city": "New York",
  "shippingAdress__state": "NY",
  "shippingAdress__postalCode": "10021",
  "phoneNumber__home": "212 555-1234",
  "phoneNumber__fax": "646 555-4567",
  "phoneNumber__mobile": "212 555-1299"
}
Azure Logic Apps
Azure Logic Apps

An Azure service that automates the access and use of data across clouds without writing code.


Answer accepted by question author

Ashwin Chakravarthy K 81 Reputation points
2020-06-10T12:48:01.367+00:00

Got the answer:

{
"firstName": "{{content.firstName}}",
"lastName": "{{content.lastName}}",
"fullName": "{{content.fullName}}",
"age": "{{content.age}}",
"emailAddress": "{{content.emailAddress}}",
"dob": "{{content.dob}}",
"billingAddress__StreetAddress": "{{content.billingAddress.streetAddress}}",
"billingAddress__City": "{{content.billingAddress.city}}",
"billingAddress__State": "{{content.billingAddress.state}}",
"billingAddress__PostalCode": "{{content.billingAddress.postalCode}}",
"shippingAddress__StreetAddress": "{{content.shippingAddress.streetAddress}}",
"shippingAddress__City": "{{content.shippingAddress.city}}",
"shippingAddress__State": "{{content.shippingAddress.state}}",
"shippingAddress__PostalCode": "{{content.shippingAddress.postalCode}}",
"phoneNumber__Home": "{{content.phoneNumber[0].number}}",
"phoneNumber__Mobile": "{{content.phoneNumber[1].number}}",
"phoneNumber__Fax": "{{content.phoneNumber[2].number}}"
}

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.