I have a situation that I cannot figure out how to do without traditional code. I know Javascript and could write a function using Toolbox, but I do not want to use a workflow. I am using this particular filtered list as the Data Source for a Repeating Group.
Here is the issue:
Lets say I have a list A with the following values:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Some of these items might, or might not, belong to a group (indicated by a field on the Thing).
If I want to display the first five items of A, this is easy:
[1, 2, 3, 4, 5]
But if any of these belong to a group, I need to display the entire group.
- The group counts a one item to display, but must show all group items
- It is unknown how many items belong to a group
So, for example, if I have Group B [2, 3]
and Group C [5, 6, 7]
, then my filtered list must be:
[1, 2, 3, 4, 5, 6, 7, 8]
Item 1: 1
Item 2: [2, 3]
Item 3: 4
Item 4: [5, 6, 7]
Item 5: 8
It’s possible there would be a group of items that should not be included. For example, if Group D is [11, 12, 13]
and List A is [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
, I still need only items until #8 to list the first five.
Because I want to use this filtered list as a data source that must remain dynamic, how can I arrive at this filtered list and know that I need to use A:items until #8
in order to show my first 5 items?
One method I wanted to try was to save the number of items in a group in a field for the group (it is a data type, so I could create that field and keep the count current). But I’m still not sure how I would construct my list filter even if I know that information.
Any help is appreciated! Thanks.