Use FQL conditional logic to select data
You can use Flows Query Language (FQL) to filter for specific data in your responses. Multiple responses return in an array. Single responses return as a single record. Sample data and FQL examples are below.
Example JSON
The examples below use this JSON object in a variable named data:
Filter query results for objects with specific key-value pairs
The example below filters for objects in the payments array that have the key-value pair "description": "recurring subscription".
Navigate your filtered results
FQL uses the same syntax to navigate filtered query results as it does to navigate JSON data. The example below gets the values from the invoice_number fields in the filtered results.
Return a single record
When a filter has a single result, FQL returns that result as a single value instead of an array. The filter below matches one payment, so it returns the invoice number as a string.
Check if a field contains specific text
The $contains function checks whether a string contains specific text and returns true or false. The example below checks whether the description value of the first item in the payments array contains the text recurring.
Get only unique payment amounts
The $distinct function returns a single instance of any recurring values. In the example below, the 110.48 value appears twice in the data, but only once in the result.