Is there a way to filtrate a list so that only every second item would be shown? Thank you.
Hey @d.norkus. How about this?
A repeating group (here using a data type called random) and set the separator to none (if you want a separator you can add it to the group you are about to create:
Within the first cell of the repeating group, create a group (example is named rg row group) that covers the entire cell and set it to Collapse height when hidden:
Then on the conditional tab of the rg row group, use this formula, which basically says hide the group if not even (this could be changed for just odd of course)
Put whatever you want in the rg row group, and you should be good to go.
Nice idea @mebeingken
@d.norkus another approach could be:
Set a custom state to retrieve the list (may not be needed depending on how the list is created).
Use Toolbox List of Numbers, set it to give even numbers up to the list count.
Use the list of even numbers as a RG data source.
In the RG cell, put a group with a source: list’s item # current even number
In the group you have access to the item.
I Bubble provides a modulo operator :mod (I think it’s labeled). An integer modulo 2 will be equal to 0 if even. If integer mod 2 is not zero, the integer is odd.
That should get you there.
any idea how to get the following structure using modulo?
1 | 2 | 3
4 | 5 | 6
7 | 8 | 9
10 | 11 | 12
Need it to get 3 different repeating groups.
The first one with database entries: 1st item, 4th item, 7th item
Second repeating group with items 2,5,8 and 11,
third repeating group with 3,6,9,12…
I guess there will be an easy solution, but I have no idea right now, except of modulo 3 for the third one.
Thanks!
okay I made it. sorry guys:
solution is:
- modulo 3 is not 1
- modulo 3 is not 2
- modulo 3 is not 0