Task input query syntax deprecated in Platform 6.7
Starting in Platform 6.7.0, task input queries and the query task share one syntax. As a result, Platform 6.7.0 deprecates some of the Platform 6.4.0 syntax for accessing a property in a task input query. An upcoming major release removes the deprecated syntax. Until then, task input queries that use it continue to run as before.
What’s changing
The shared syntax adds support for data filtering and manipulation to task input queries via filters, helper functions, and other added syntax. Most Platform 6.4.0 task input queries work the same way as before. Platform 6.7.0 deprecates only what the shared syntax reads differently.
The following syntax for accessing a property is deprecated:
The :getLiteral() helper function is new in Platform 6.7.0. It reads its argument as plain text, which makes it the replacement for any key that contains a special character. For more information, see Query a key that contains special characters.
The following example shows a Platform 6.4.0 task input query and its replacement.
Deprecated:
Replacement:
The rest of the Platform 6.4.0 syntax isn’t deprecated. The [*] wildcard is supported, and only [*] used to access a property named * is deprecated. Dot notation still works for a key that doesn’t contain a special character, such as region_id. Array indexes, such as devices[0], also work as before.
In the shared syntax, ["device_name"] accesses a property named "device_name", including the quotation marks, and [*] is a wildcard that returns every value in an object or every element in an array. In Platform 6.7.0, the Update action in Studio converts deprecated syntax to the syntax in the Replacement column, so the query returns the same value in the shared syntax. For more information, see What should I do?. After Platform removes the deprecated syntax, task input queries that you haven’t updated return a different value or fail.
Timeline
What should I do?
Update each affected task input query before Platform removes the syntax. Studio displays a warning next to each input field that has a query with deprecated syntax, and an Update action next to the warning. The action does the following:
- Converts only the deprecated syntax in the query and leaves the rest of the query unchanged.
- Preserves the value that a matching query returns.
- Clears the warning for that input field.
A task input query that failed in Platform 6.4.0 can succeed after the update. For example, when devices is an array, devices[*] took the task’s error transition in Platform 6.4.0 because the array has no property named *. The updated query devices.* returns an empty array instead because this is the new array pluck syntax, so the task takes its success transition. Review any task whose input query previously failed due to attempting to access a property from an array.
The update applies to one input field at a time. The change isn’t saved until you save the workflow. If you leave the workflow without saving, Studio discards the update and displays the warning again.
You can’t revert an update to the Platform 6.4.0 syntax. If you add or update a task input query in Platform 6.7.0 and then roll back to an earlier release, the query might not run correctly. Back up your workflows before you add or update task input queries.
Related resources
- For more information about
:getLiteral(), see Query a key that contains special characters. - For more information about task input queries, see Task input query.