Pull Values from Lists and Objects
Airkit's internal programming language, Airscript, parses both Lists and Objects, which are structured similarly to arrays and objects in JSON:
- Objects consist of any number of key/value pairs. Key/value pairs are separated by colons and the Object they make up is delineated by curly braces {}.
- Lists group together any number of values in a specific order. Values are separated by commas and the List they make up is delineated by square brackets [].
Accessing specific values within an Object or List can be done in two ways:
- A Path Expression can be used to reference items in a List by their index and values in an Object by their key.
- A Query Expression has similar functionality to LINQ (Language Integrated Query). Given a List or Object, it returns valuesย based on the given criteria.
Path Expressions can be used in Query Expressions and visa versa. Both are valid Airscript expressions, which can be nested indefinitely.
While there is some overlap in the functionality of Path Expressions and Query Expressions, they were designed with different use case in mind. Path Expressions should be used when you already know where the value you want to access is stored, while Query Expressions should be used when you want to sort, filter, or drastically restructure information. For more on they syntax of Path and Query Expressions, see Path Expressions and Query Expressions respectively.
Updated over 1 year ago