Dashboard designer dashboards support a variety of interaction functions that get data from a source query, manipulate it, and serialize it to make it consumable by the target query.
If the input data has empty results, the function returns a null value. If the specified location of the data doesn’t exist, an error occurs. For example, the interaction is defined to get data from row 3, but row 3 doesn’t exist. An error also occurs if the shape of the input data doesn’t meet the requirement for the function.
Interaction functions operate on input data with one of these shapes.
Scalar value, like
"this is scalar", or
One-dimensional array, like
([1, 2, 3])or
Two-dimensional array (an array of arrays), like
([ [1, 2], [3, 4] ])
The required shape of the input data varies with each function. After processing the data, the functions can change the shape of the data.
Each interaction consists of nested functions. Each interaction must have one data selection function and one data serialization function. Optionally, interactions can have multiple data manipulation functions. This example illustrates how nested functions in an interaction work together to produce the expected result for a target query in which they’re defined. The example is based on this interaction.
mySourceStep query has this input data.
Technically, the data for this query is stored as a two-dimensional array, where each row is stored as a map of key-value pairs.
At runtime, CRM Analytics evaluates the interaction functions, starting with the innermost function. Using that logic, CRM Analytics evaluates the example’s interaction functions in this order.
|CRM Analytics returns each row of selected data as a map of key-value pairs. If a single selection is made, only one row returns. If multiple selections are made, multiple rows return.|
coalesce function to provide a default value so that an error doesn’t occur when a null value is encountered.