JSON documents can be created in PhixFlow using the toJson function and the output modified using the following notations.
Curly Brackets { }
Use curly brackets to create an object, e.g. { "FirstName" : "John", "LastName" : "Smith", "Age" : 50 }
Colon : and Dot .
Use a colon to define a key-value pair, e.g. { "key" : "value" }
The key must always evaluate to be a string
The value must always evaluate to be a string, number, object, array, boolean or null
Use a dot to access the key and value, e.g. $foo.key:$foo.value
Example using curly brackets, colon and dot
Input
{
forEach(
//Convert the data from the lookup, getCo, to JSON and store it in the variable $company
$company, toJson(getCo),
/*Using the $company object, create a key-value pair where the key is the Company Name and the value is an object containing two key-value pairs of the CompanyID:value and Industry:value*/
$company.CompanyName : $company.CompanyID:Industry
)
}