How to limit the total number of items shown by 2 merged searches? (Repeating group)

Hi everyone,
I limited the number of items shown in a repeating group by using “:items until #”.
Now I need to merge the search with another search. Is there a way to limit the number of items shown in total, after the 2 searches have been merged?
As you can see in the screenshot, the “:items until #” applies only to a single search (the first one) and I believe that if I use it at the end of the expression, it will apply only to the second search, before it gets merged.
Thanks!

Screenshot 2023-01-30 at 15.16.35

Hi there, @snowsnow… I don’t have data in my sandbox app to test such an expression right this minute, but it looks like you might be able to do what you described if you enable the experimental parentheses feature.

items

Keep in mind that an experimental feature can go away at any time (although, I would be shocked if this one went away at some point, but you never know), so you might want to be careful about building critical functionality on top of it. That being said, it couldn’t hurt to try what I showed in my screenshot.

Hope this helps.

Best…
Mike

Edit: I just tested it, and it works as expected.

1 Like

If you have any sorting on each of your searches, it actually will stack the 2 lists on top of each other, so your items# will always return from the first list first, and then the remaining from second list.

If you’d like the lists to be properly merged and sorted in the same way (i.e lists not stacked, but all values sorted together as one list) you’ll need to get the list shifter plugin, feed in the merged list then sort that list as you want and use the result items# in your repeating group.

Or just do (Search for Thing merged with Search for Thing):sorted:until item #10

Yes, depending on if the sort you want is available in that operator.

I prefer list shifter though :slight_smile:

2 Likes