Insert a index in formatted as text

Hello everyone…

I’m literally going crazy doing it, I hope there’s a way. I’m building a list of elements through formatting as text. I have to insert the index of the photo in position… or simply an increasing number for each line of the list. Does anyone know how to do it?

You can’t directly reference the index.
BUT there is a solution - you can grab the unique IDs (or any identifier) of the constituent items and use some string manipulation to grab the index.

I usually pull the same list of items that populates the list I’m running :formatted as text on.
In this case it is Parent Group’s Immobili’s Fotos.

Now pull the unique_ids of each item (or any identifier - email, url, etc).
So here let’s do Parent Group’s Immobili’s Fotos: each item’s image URL
We will use this to identify the current item in this list of identifiers.
Get this list of URLs as a comma separated text.
We’ll get URL1,URL2,URL3,…

Now we basically split this text containing URLs by this Image’s URL, and take the first item
If this Image’s URL was URL3, we’ll get the resulting text as URL1,URL2

Now simply split this by ‘,’
and get the count.
This will be the index of each iteration!

Here’s an example you can pull in with Atomic Fusion:
Example: Get this list of URLs as a text

1 Like

I’ve linked a working example above
You’ll be able to copy/paste that into your app and see it under the hood.

Here’s a better explanation:

Let’s say the list of things you’re running is X

Now each item in X will probably have some text identifier. Something unique. In your case it is a URL.

What I would do is create a comma-separated text of the URLs from all the items in your list.
This looks like URL1,URL2,URL3,…
Let’s call this the URL-list

This text will also contain the URL of each item being iterated on in the :formatted as text operation.

So you can split the URL-list by this Image’s URL to get the list of URLs before the this Image’s URL in the URL-list and use that to calculate the index.

In my example, I’m doing it on a list of Users:

1 Like

I think I succeeded, but skip a number… Why do you think?


Before :count, add a filter to remove any empty values
That should do it

1 Like

Wow, it worked… I’m literally going crazy since yesterday about this! You’re a great friend!

Glad that helped :slight_smile:

1 Like