Serialization functions convert the data into the form expected by the query in which the interaction is inserted. For example, if the interaction is used in a compact-form query, use the asObject function to format the data into a one-dimensional object.
asDateRange Function
Returns the date range filter condition as a string for a SAQL query. The date range is inclusive. Use the string as part of a filter based on dates.
The input data must be a one- or two-dimensional array. If the input data is a one-dimensional array with two elements, the function uses the first element as the minimum and the second element as the maximum. Null results in fieldName in all, which applies no filter.
Returns an equality or “in” filter condition as a string for a SAQL query. The input data must be a scalar, one-dimensional array, or a two-dimensional array.
If a single field name is provided, the returned string contains the in operator for a one-dimensional array, fieldName in ["foo", "bar"], or the equality operator for a scalar, fieldName == "foo".
If multiple field names are provided, the returned string contains a composite filter. For this case, a two-dimensional array is expected. The number of values in each array must match the number of specified fields.
If the input to this function is null, the function returns <fieldName> is null, where <fieldName> is the first field. For example, if cell(step1.selection, 0, "column1") evaluates to null, cell(step1.selection, 0, "column1").asEquality("field1") evaluates to 'field1' is null. If there are no selected rows, cell(step1.selection, "column1"), the function evaluates to <fieldName> in all.
Note
Syntax
1<input data>.asEquality(fieldName)
Arguments
Argument
Description
fieldName
(Required) The name of the field.
These examples are based on the myStep source query. Assume that myStep.selection is:
Let’s look at some examples where the selection determines the groupings in a SAQL-form query. These examples are based on the stepFoo source query. Assume that stepFoo.selection retrieves these rows from the query.
To make the interaction return multiple fields for the grouping, replace the cell interaction function with a column function and update the arguments.
Returns the query expression and alias as a string that you can use to project a field in a query. The query expression determines the value of the field. The alias is the field label.
Use this function to write a foreach statement for a field projection. The function concatenates the query expression as and the field label in this format.
1<`query_expression`> as <`field_label`>
Here’s a sample projection that rounds the price to two decimals and stores the result in the SalesPrice field.
Returns a range filter condition as a string for a SAQL query. The range is inclusive.
The input data must be a one-dimensional array with at least two elements. The function uses the first as the minimum and the second as the maximum. Null results in fieldName in all, which applies no filter.