A list of first items of other lists


Lets say I have a data type called Client and a data type called Invoices.
Clients have a Field that is a list of Invoices.

I am struggling big time to have the list of the first Invoice of each client.
does anybody know how to do this list ?

Thanks a lot !!

Instead of having a field within the Client thing, you’ll probably need to create a new thing called something like ClientInvoices. This thing will represent the relationship between Clients and Invoices.

The field as a list is quite limited in what you can do with it in terms of searching and sequencing.

How are you using the list of first items? You can do it via a RG & RGextractor plugin if you need to actually make a new list.

couple more ideas; you could use a recursive backend workflow to save the first item of each list to the database.

or when a client creates an invoice it could add that invoice to a field that is “first invoice”.

Just depends on use case really.

@acaffin: To get such a list at all, you’ll actually want to configure your datatype such that not only do Clients have a list of Invoices, but that Invoices also have the relevant Client on them.

Also, I don’t believe there is an expression you can build in vanilla Bubble to come up with the list you desire. However, it’s easily accomplished in the page with my List Shifter plugin.

I’ve built an example of that here that, if you’re interested, I could explain in a video:

Here’s the runtime:

And here’s the editor page for that:

Thank you very much I ended up creating a new field so save the item I need everytime…

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.