Temporary Fields
- Any field name that starts with the character
_
is considered atemporary
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 :
[
{
"_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