An Action Script can be evaluated against a specific record or, if the content of the script allows, without specifying a record first.
Use the action script and specify a record. The script contained in script will be evaluated against the record.
It is possible to set variable values during evaluation of an ActionScript. The values of these variables are returned in data. All variable names are returned in lower-case – variable names are not case-sensitive within scripts.
Note that this is an extremely flexible way to calculate and extract information of any complexity from a PYXI application. You can use the full power of the scripting language to evaluate multiple records, perform calculations etc and have all the variable values returned through this API call.
Similar to templates, Action Scripts can act on data passed in the API call. This data overrides what would otherwise be evaluated using the variable name (if anything).
Note that this is, of course, an over-simplified example to demonstrate basic syntax. In practice, if you just needed to add a single record like this, you would use the Add Record API call instead so you get the record id back in the response.