Repeating group with two datatypes

Hello, I have a repeating group which should display both docs and forms, sorted by modified date. A row displays either a doc or a form.

So the end result could look like this for example:


My solution would be to create two groups in each row of the repeating group, and put a condition to hide it when it is empty. (well, now I think of this I don’t know if this is right).

Let’s say I amn the right way here, then I am bit stuck here in what to put in the elements.
I reckon I should keep the type of content and data source on the repeating group element EMPTY, as it should display two data types. But what do I put in the two groups? Datatype = docs in the first group, and datatype = forms in the second, of course. But what is the data source? Do a search for? For what?
I hope someone can help.

A RG cannot load two different datatypes.

So, one way to do this is to create a joining datatype, then load those into the RG and use conditions on the elements to display the relevant info inside each cell.

Another way is to load both sets of data somewhere onto the page (i.e. in two hidden RGs), then set your third RG to have a type of Text.

Its datasource should be the First RGs list of things each items unique IDs merged with the second RGs list of things each item’s unique ID.

Then you can have a group that relates to RG type 1 - with its datasource as the RG1s list of things, filtered: unique ID is current cell’s text, and the same for RG type 2 - with a condition on each group pot hid it if it’s Thing is empty.

Then put the relevant elements/content into each group.

This method will be much harder to sort or filter - you might have to run some kind of iteration to add each item to the third RG’s datasource in the correct place.

Whereas, with the first option you can include some additional fields for sorting/filtering purposes.


Ok, will try the first option first then. :slight_smile:

EDIT I first want to try another solution: to “use” one of the two datatypes for both. This has to be of type file, since one of the two (docs) is using files. So I will be using the datatype docs.
The records for forms just won’t have a file stored. Maybe I can distinguish it by a boolean field (doc or form).