New expressions
We have added a range of new functions in order to make it simpler to model more complex logic.
Beyond exact matching for string concepts
When you compare data within a rule, the string had to be an exact match, including the correct case. This made it difficult when the data quality can't be guaranteed (for example an end-user free-typing an answer).
A new set of string functions increase the flexibility of how you match data between different relationships when making inferences, ranging from simple partial string matching to counting complex regEx patterns identified in a string.
includes - confirm a string contains a set of characters. E.g. infer a country based on a full address containing 'United Kingdom'.
startsWith & endsWith - when you can be more specific than includes, these functions confirm a string starts or ends with a certain set of characters. E.g. A UK postcode that starts with NR is likely to be in the Norwich area.
regexCount - when your data is less structured or you are looking for a pattern more complex than can be achieved with the above functions, or you want checks to be case insensitive, this advanced function allows you to define your pattern as a regular expression. It will return how many times that pattern has been matched. A detailed guide for how to use regexCount can be be found here.
More options for managing data as lists
Data on a plural relationship can often be referred to as a list (or an array) and people often want to make a decision based on a comparison between the items in the list.
For example a triple of (Band) > has tour dates > (Dates) would give a range of dates for a band and you might want to know the earliest or latest date they are playing, or construct a result string that listed the dates like "The Rainbirds are playing on the following dates:....".
Previously this would have been challenging, but with the new list functions, this becomes much simpler.
minObjects - get the lowest date or number from a list of objects. E.g. get the first date the band is playing.
maxObjects - get the highest date or number. E.g. get the last date the band is playing.
joinObjects - join a list of objects into a single comma-separated list. E.g. add all the tour dates into a single result string that reads nicely without having worry about how many items are in the list.
Simplified expressions
To make it simpler and more natural to write a rule, we've added some expressions that could be achieved with existing ones, but that users found odd or error-prone.
isWithinRange - Check if a date or number is within a given range. To check an age is between 0 and 17 a simple function of isWithinRange(%AGE, 0, 17) can be written, avoiding longer and error prone expressions of (%AGE is greater or equal to 0) and (%AGE is less than or equal to 17)
subtractDays / subtractWeeks / subtractMonths / subtractYears - We had functions for adding days/weeks etc. and you could subtract by adding negative numbers. However this isn't very intuitive so when you want to subtract from a date, you can now use a subtract function.
We hope you enjoy these new expressions.
Last updated