Enumerate a list in a single text line

Hello everyone,

In case someone needs to enumerate a list like that :

“3 sea bass (50cm, 65cm, 45cm) - 2 octopus (2,5kg, 3,2kg) - 1 mullet fish”.

To give a concrete use case : for all my fishing sessions, I wanted to dynamically write the species that I’ve caught in that session. I wanted also to show the size of them if there were a size declared.

image

Instead of using a repeating group and work by cell, you can also use a single text element ! I’ve noticed that it was quite efficient in term a time loading.

So I have a feed with all my fishing sessions. The feed is a repeating group of fishing sessions. Inside each cell, I have a single text element that gave me a list like above :

Details :

I’m going to search my data type where I store the fish declaration : “Species-Declare”. One Species-Declare = one catch. I have 3 fields in that data type : species, size and unit (cm or kg).

Inside the text element, I group by type of species and I add a new count aggregation so I can count all the catches by species :

Then I add “format as text” :

image

I wanted to separate the catches where the size was empty. So it would look like that :

  • “3 sea bass” = size empty
  • “3 sea bass (45cm, 34 cm, 58cm)” = size not empty

For that I put a first condition : if sum of size = 0 then there is no size.

To write something different depending of the result I add “formatted as text” again :

image

If there is no size, that is just : This Grouping’s count This Grouping’s species ( 3 sea bass )

If I want to add another list for each species of that group (size 1, size 2, size 3), then I have to add another “Search for” :

image

and again “Format as text” where I add the size :
image
image

So thanks to that, you have an efficient way (regarding the time loading) to show a list group by type in a single text element while still showing some of their uniqueness (size in my case).

image

Hope it will help and that I have explained it well (my english is not that great :joy: )

3 Likes