Some questions about searching the DB when populating a popup

I was wondering today about a few things.

When clicking on a cell in the RG I send a user to populate a popup. This user has other Data Types linked to some fields, let’s say additional info.

Since the popup has been populated with the user, now I can get any data from it directly using “Parent group’s User’s [field]…”. I can also access fields that have other related Data Types and consequently the fields of those Data Types.

So my questions are:

1 - Would the act of sending this user to populate the popup count as a specific search in the DB or will the search be considered as the one already performed on the RG?

2 - With the popup already populated, can I use the data to do any other operation like counting, returning the first, grouping, aggregating, summing, etc., without a new search being counted?

3 - If I do a new search inside the popup, looking for one of the other Data Types related to user fields, to perform any other operation, would that search count as a new search?

Thanks in advance for any clarification or help.

The search has already been done (in the RG), and the data already loaded to the page. So no additional database requests will be made to ‘send’ the User to the popup). But… if inside that popup you make reference to connected Things fields, then those things will be retrieved from the database (as individual data requests).

Those are all List operations, so you can’t do those in the single thing which the Popup refers to… but you can do what you whatever with the data already on the page (i.e. the data that was retrieved to for RG).

It will if that data has not already been loaded to the page. And if it has, then it won’t.

1 Like

Thank you so much @adamhholmes !

1 Like

Although I marked it as solved, could you clarify some additional details?

If I understand correctly, in the RG searc honly the User data type was requested from the DB and the list was loaded onto the page. So when sending the user to the popup, I am sending data already downloaded in the browser. However, the lists of related things in User fields (fields containing other types of data) still not loaded in the browser? Is it like that field is still empty or something like that? So if I access this connected field, using Parent group's User's [Related Field] a new request is made and the data from this other list is downloaded in the browser?

Regardless of the situation, if I want to do three list operations on the same related list (contained in a user field), say a count, an aggregation with sum and a filter with an additional constraind, I could use three different expressions of the type:

Parent group's User's [Related Field] [List] :count

Parent group's User's [Related Field][ List] :grouped by [Field to group] [Sum Aggregation]

Parent group's User's [Related Field][List] :filtered :[any operator]

1 - Would each of these expressions be a different request to the DB?

2 - Would it be more appropriate to return this list of the related field, in a generalized way (without filters and operators, something like Parent group's User's [Related Field] [List]), somewhere in the popup, and then use this generic return to do other operations?

Yes indeed (assuming it’s a list… if it’s just a single thing then obviously just that thing will be retrieved).

Again, it depends whether the data has already been loaded or not…

But for the most part, if you’re doing aggregation (count, sum, and grouped by), you’ll be better off to do a separate search for those, rather than loading data unnecessarily to the page first.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.