FLOIP / flow-spec

7 stars 6 forks source link

Upgrades to the Expressions spec #45

Closed markboots closed 3 years ago

markboots commented 3 years ago

The following proposals to the Expressions spec are useful to support validation of data in exit tests, and do meaningful operations with array data within the Context (e.g. within a Contact):

  1. Add ISNUMBER(), ISBOOL(), and ISSTRING() to support validation of data received in block exit tests
  2. Add NULL type, and the ability to test against NULL
  3. Add BETWEEN() function to simplify comparisons within a range
  4. Add CONTAINS() function to enable keyword matching within strings
  5. Array handling: ARRAY() generator function, and IN() function for testing membership within arrays. This is necessary because the context (including Contacts) has objects with array data types. A common use-case is to check if a contact is a member of a group.
  6. Add COUNT() function for number of items in arrays.

Note: In the course of developing the open-source Flow Runner and Flow Builder implementations, the initial dev team proposed a list of cleanups and clarifications to the spec. This is one of a set of changes proposed to improve consistency, usability, and functionality of the spec based on the first complete build-outs.