There appears to be a problem with this, in that the undefined variable inserts the text 'null' into the query. I'm using a REST query, with groups/{{groupName}}
. My REST Api will accept a request without a value for group name (e.g. groups/
), but if the name is specified, it must be valid or the request will error.
As noted in the post, the groupName
is shown in red with 'groupName is not defined'. I've tried variations on testing the value for null, but all it does is translate to a REST call with the word 'null'.
All of these produce the same result (groups/null
):
groups/{{groupName || ''}
groups/{{groupName ?? ''}
groups/{{!groupName ? '' : groupName}
groups/{{groupName === null ? '' : groupName}
groups/{{typeof groupName === 'null' ? '' : groupName}