Is there a way to send the results of different queries to the same table?
If I have qryOne
and qryTwo
, what would the syntax be to indicate to a table's Data field that either query could populate it?
I tried {{qryOne.data}}{{qryTwo.data}}
, but it's obviously not quite that easy...or is it?
ksiegel
February 4, 2021, 10:41pm
#2
Hi Wrapmate, do you want the results of each query to be in the table one after another or is there some logic to display the results from qryOne
or qryTwo
?
2 Likes
I’ve figured it out! In the interest of sharing (or revealing that I didn’t do it correctly) here is how I approached.
@ksiegel , to answer your question: it is either/or - either qryOne
or qryTwo
…but never both at the same time. Here’s a screenshot to illustrate:
Here’s what ended up working:
The top 3 fields & search button trigger qryOne
.
Changing the field of the bottom 4th field triggers qryTwo
.
I created a new JavaScript query called qryReturnResults
that includes this code:
var obj = eval(triggeredById);
return obj.data.data; // the subkey is also 'data'
In both qryOne
and qryTwo
, under the General tab, scroll down AFTER THIS QUERY RUNS , in the On success trigger , enter qryReturnResults
.
Finally, in the table’s Data field, enter {{qryReturnResults.data}}
Now, either the top 3 fields & search button…or the bottom 4th field…can trigger a query that populates the table.
Open to hear feedback on if this was correct, or if there is a better approach!
2 Likes