Temporary Fields

  • Any field name that starts with the character _ is considered a temporary field.
  • Sometimes we would need to store intermediate field values, but would not want them in the final output. We can use temporary fields for that.
Field selection & de-selection

Any field name which starts with _ does not appear in the final output. We can use this for field selection and de-selection.

  • For example :
{
"name": "John Doe",
"age": 30,
"email": "johndoe@example.com",
"isEmployee": true,
"address": {
    "street": "742 Evergreen Terrace",
    "city": "springfield",
    "state": "Illinois",
    "country": "United States"
    }
}
{
"name": "John Doe",
"age": 30,
"email": "johndoe@example.com",
"isEmployee": true,
"address": {
    "street": "742 Evergreen Terrace",
    "city": "Springfield",
    "state": "ILLINOIS",
    "country": "USA",
    "address": "742 Evergreen Terrace, Springfield, Illinois, USA"
    }
}
[
    {
        "_fullAddress": "[input.address.street,input.address.city | capitalize ,input.address.state] | join(', ')"
    },
    {
        "address": [
            {
                "street": "input.address.street"
            },
            {
                "city": "input.address.city | capitalize"
            },
            {
                "state": "input.address.state | upper"
            },
            {
                "country": "input.address.country == 'United States' ? 'USA':input.address.country"
            },
            {
                "address": "derived._fullAddress + ', ' + derived.address.country"
            }
        ]
    }
]
_fullAddress: [input.address.street,input.address.city | capitalize ,input.address.state] | join(', ')
address:
    street: input.address.street
    city: input.address.city | capitalize
    state: input.address.state | upper
    country: input.address.country == 'United States' ? 'USA':input.address.country
    address: derived._fullAddress + ', ' + derived.address.country