json.select resolving to null with no match
long-term
N
Nutty Tyrannosaurus
It would be useful to be able to natively evaluate whether an output variable using json.select has found a successful match/result.
Use case: an API step receives a httpResponseBody, with an output variable based on a key:value from a json.select statement.
Example output variable: <+json.select("workspaces[?(@.data.displayName == '<+pipeline.variables.accountDisplayName>')].data.id",httpResponseBody)>
We want to have a subsequent step with a conditional execution based on whether the json.select statement finds a value. In cases where the json.select does not find a match, the output variable is:
<+json.select("workspaces[?(@.data.displayName == 'example_name')].data.id",httpResponseBody)>
Since this is not a null value, we're unable to use isUnresolved expressions in subsequent conditional execution expressions. Therefore we'd like to be able to assess whether the output variable resolved to a match or not.
At the moment we are using an intermediary script step to evaluate the variable, but this is an inelegant workaround.
Log In
Sudarshan Purohit
marked this post as
long-term
Shylaja Sundararajan
marked this post as
under review