JSON Support
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
In PhixFlow version 11.3+, JSON parsing in expressions ignores any key-value pair where the value is unavailable.
Example using curly brackets, colon and dot
At @ and Dollar $
- @ can be used to reference the current object
- It allows access to any key-value pairs that have already been set
- Use the syntax
@.^.
to traverse upwards
- $ can be used to reference the outer object of the current object being created
- It will allow access to any key-value pairs that have already been set
Example using @
Example using $
Date Handling
JSON support now automatically converts date and date-time values into a their corresponding string representation.
The output format is:
- YYYY-MM-DDTHH:mm:ss.SSS.Z
- For example: 2024-09-13T16:19:10.000Z
See Date and Time Format Patterns