How to "split" RG into individual index based on 1 number value

Hallo All…

Can anyone guide me how to “split” RG into individual index based on 1 number value in the database? I tried to use the “Toolbox Plugin” Number List but I can’t get around how to do it.

Example below, the user saved the number of nights into the database. I need to split the ‘number of day’ into multiple row (for user to plan their daily schedule based on the number of nights selected.

I look at this solution by @tylerboodman but I still can’t figure out how. (Tagging Tyler to seek help as well).

Thank you guys in advance for the great help!

Hey @christina1 ,

Place the ListofNumbers element somewhere, set the minimum number to 1, max to Do a search for Itineraries, sorted by No. of Day, decending no then after the search do :last item's No. of Day

RG 1 set up to be a horizontal cells (1 row), make the data source searching for your Itineraries.

Put RG 2 inside the RG 1 cell, setup as a vertical layout (1 column), datatype will be number, and set it to the List of Number's list of numbers:until item # Current cell's Itineraries's No. of Days

Inside RG 2 put some text with Current cell's number

Or instead of RG2 if you just want basic text shown, you could do a text element, data source is the same as what RG2 would be, then do :format as text inside the window do This number, then set the delimiter to a newline

If this is something where the user logs notes-per-night or something, you would need to look into restructuring so you create a database Thing per night instead of just visually listing numbers on-page

Thank you so much for this guidance @tylerboodman :slightly_smiling_face: I tried the ways mentioned… I think I may have to restructure the database as indeed I need to have data per night after the “split”. I thought if there is a shortcut to split the days first then push it to database… so that way it won’t take up so much of ‘database’ space especially if it involves 12 days then 12 lines will be automatically created without a second trigger for example before adding notes per night into it…

1 Like