Nested Paged Query with Table Generator?

Not had a reply yet but have tried every variation that I can possibly think of and just will not work. Hopefully one of the Team can give us some directions? @George @Teodor

Hello Dave,
What’s your goal? What needs to be displayed in the table and how?

Hi Teodor,
Its a query using the output of another query (paged) to populate a repeat for the Table Generator. No matter which way this is structured (see above images) the output is not correct and the table is only populated with the first result and does not repeat the results of the repeat query.

Dave, what and how do you want to display in the table?
I.e. what data of the first query? What data of the nested qurey? How should they be displayed?

HI Teodor:

My goal is a nested table with the following output

Name of Department 1 ( from rs.1)

Account Balance 1 (from rd.2, filtered by Name of Department1
Account Balance 2…Account Balance (n) (from rs.2 based on filter of Name of Department1)

Name of Department 2 (from rs.1)
Account Balance (1) ( from rs.2 filtered by Name of Department 2)
Account Balance (2)…Account Balance (n) ( from re.2 filtered by name of department

etc. until to the end of rs.1

You can’t do that automatically with the generator. You should do that manually, applying the nested repeats where needed, as explained here:

That’s what I thought. Just seeing if we could use the generators for other purposes.

Thanks

Query 1:

Look-up the Users support tickets by session variable using connection 1 (no output).

Repeat:

Output the ticket UID

Query 2:
Use the output from query 1/repeat (ticket UID) to lookup tickets with same UID in connection 2 table 2.

Use this output to populate the Table Generator. To add to this I’d like this to be a paged query result.

Have also tried to do this without the table and using a simple repeat but still only the first row is returned from the nested query. Yet if I select the first query with the output un-checked the results are shown… Obviously I want the repeat of these results from the repeat query with output checked.

What is the code generated on your page? Probably you have wrongly selected any expression.

3

Server Connect:
4

< div id=“repeat1” is=“dmx-repeat” dmx-bind:repeat=“AllCurrentSupportTickets.data.RepeatTicketUIDs”>
< p >{{extRef}}</ p>

This works.

Dave can you try explaining your issue from the beginning as I don’t understand what’s wrong exactly…
Also - what the output option in Server Connect does is to output the results on the page. It does not stop items from being repeated.

I have two tables on two connections.

Connection 1 looks up the user and relates them to entries via session from table 1. Output is unchecked.

I add a Repeat using this outputs results.

I then add Connection 2 and query table 2 using the result from the first query. This output is checked.

This is the output I wish to repeat.

But Dave, how should this nested repeat be displayed on the page? Just it on the page, without being wrapped with it’s parent repeat? How many results does the parent repeat return?
Of course it will only return the first result of the parent repeat if you only use the nested repeat without the parent one wrapping it.

Have you checked this tutorial: Nested Repeat Regions ?
It explains exactly how to use nested repeats - make sure to just follow it exactly.

I’m going about this the wrong way most definitely.

I’m not sure it’s nested queries I need.

I need to take the output from Query 1 and use it to populate query 2 to use as a repeat. That’s the basic synopsis… It’s across two connections and two tables. Is this possible? My wife is looking at me with that ‘wife look’, as wives do… :wink:

Then it’s not nested queries what you need.
Steps should be:

  • query 1
  • repeat (query 1)
    • setvalue step (here add the query value you need)
  • query 2 (filter it with the setvalue step value)

Dave.Bit confused but are you saying you want to select a single value from table 1 then select multiple child records from table 2 where there are linked via a key from table 1?

Hi Brian,
Yes from table 1.