How to identify the last-child within a list

I have two collections - 1. links and 2. folders
While all links are supposed to end up in to folders, there could be state where they are unsaved links.

Here’s an example:
List of unsaved links: Link 1, Link 2, Link 3
List of folders created by user: Folder 1, Folder 2

So what I want to display is this:

Link 1
Link 2
Link 3
- Folder 1, Folder 2

Now, if the user adds another link - “Link 4”, then this is what they should see.

Link 1
Link 2
Link 3
Link 4
- Folder 1, Folder 2

So far, I’ve been able to create a nested list, but that displays Folders for each Link, like so:

Link 1

* Folder 1, Folder 2

Link 2

* Folder 1, Folder 2

Link 3

* Folder 1, Folder 2

But I only want it to display for the last link (“Link 3”).
Hopefully that explains the problem. Anyone have any ideas? Is there a way to identify the last-child in a list?

Hi @adommeti,

Welcome to the community :partying_face:

We could use a number property in the Links collection and use the Max feature!

See here : Links and Folders.mp4 - Google Drive

The ID property that Adalo gives doesn’t seems to have these options so we can use a number property. Maybe this could be a feature request.

Thank you

1 Like

Hi @dilon_perera, thank you so much for your response. I super appreciate you taking the time to create a video explaining your solution. It worked perfectly for me!

And yeah, does feel like this could be a feature. Thanks again!

1 Like