question

AshwinChakravarthy-3757 avatar image
AshwinChakravarthy-3757 asked ·

JSON to JSON liquid transform

I want to convert this:

 {
   "firstName": "John",
   "lastName": "Smith",
   "fullName": "John Smith",
   "age": "32",
   "emailAddress": "smith1234@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": "smith1234@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
2 comments
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AshwinChakravarthyK-2009 avatar image
AshwinChakravarthyK-2009 answered ·

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}}"
 }
Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.