Exercise files
You can download my demo files here, but I recommend you to type everything yourself.
About Extract values from records
The simplest form of field access is required field selection.
It uses the operator x[y] to look up a field in a record by field name. If the field y does not exist in x, an error is raised.
The form x[y]? is used to perform optional field selection, and returns null if the requested field does not exist in the record.
For example:
[A=1,B=2][B] // 2
[A=1,B=2][C] // error
[A=1,B=2][C]? // null
Collective access of multiple fields is supported. For example:[A=1,B=2][[B]] // [B=2]
[A=1,B=2][[C]] // error
[A=1,B=2][[B],[C]]? // [B=2,C=null]
Was this helpful?