JSON to JSON Liquid template transformation

285 Views Asked by At

I am very new to this Azure Liquid templates. I'm parsing JSON to JSON using Dot Liquid.

I have "userDefinedFields" under "data" is an array of 4 fields i.e., Reason, Number, Bill and Key. In JSON, sometimes "userDefinedFields" may have 4 fields or 3 fields or 2 fields. I have to get all the 4 fields (Reason, Number, Bill and Key) from "userDefinedFields" and rest fields from "data" as an output of Liquid transformation:

    id
    newID
    userDefinedFields : 
        if name=="Reason", get the value
        if name=="Number", get the value
        if name=="Bill", get the value
        if name=="Key", get the value

I want Liquid template code to pick all the 4 fields together as one set (whether it has null value or proper value).

What can I try next?

0

There are 0 best solutions below