-
Notifications
You must be signed in to change notification settings - Fork 11
Description
According to the docs, the second argument for the <%QUERYBUILDER%> command is for the output format, which is not always the case.
Overview of issue
If the second argument is one of the predefined output formats (i.e., {text} or {uid}), the command will return the first selection (i.e., column) of the Query in that format.
However, if you pass the name of any other selection as the second argument - or the first selection if it's been renamed - the command will return the {text} of that selection.
Secondary issue
When purposefully passing a selection - and not an output format - as the second argument, the command does not parse the <%GET%> command.
Returns the uid of the first selection, regardless of it's name
<%QUERYBUILDER:queryId,{uid}%>
Returns undefined even when columnName is set to a selection found on the query
<%QUERYBUILDER:queryId,{<%GET:columnName%>}%>
Returns the text of the "Client" selection, regardless of it's position
<%QUERYBUILDER:queryId,{Client}%>
Proposed solution
Update the command to take 4 arguments:
- Block ref or alias
- Format of output
- Selection (default to Text)
- Number of results
Ensure the arguments are parsed before the command is run so <%GET%> can be used for any of the arguments