Dynamic data into collection

Hi everyone :wave:

It’s me, again :sweat_smile:
I would like to display dynamic data on my collection

Dynamic data are “Propositions”, “favoris”, “offres postulees” and “alertes cres”
This data is on another tables on my backend (supabase)

Table favorite, jobs… etc

But I can’t find an idea how to do this.
It’s possible to add dynamic data on a collection ?

Thanks in advance ! :pray:

1 Like

Hi Freddy,

What about those divs?

Are they dynamic, or did you manually make them?

The way I handle this scenario is that I make sure to have my data in a similar format to below:

Say I have this data in a variable called candidats. When I make elements to repeat in WeWeb’s editor, it will create two Flexbox because it is an array with two indices:
image

These flexboxes/divs will be your candidat container as shown in your screenshot, in this case SallaBerry.
image

I can now bind the texts in the div to the keys candidat, inscription, endroit and so on…
Now within this flexbox, at the bottom I would add a div in which I would bind elements to repeat to the datasets object. You would now have (in this case) two repeating divs and for each you could access the following:
image

And so on. If your propositions table, favoris table, offres postulees or alertes crees tables are separate, then in supabase I would make an API call that sends a join to your front-end to create a similar collection to the one I showed above. Some fancy Javascript/Formulas can be made to create the same object, but it’s always good practice to have your backend send you the necessary info!

That’s how I would do it, not sure if that is of much help to you.
Bonne chance :slight_smile: !

1 Like

Hi :wave:

These div are dynamic :sweat_smile:
I have a table candidate with this data

image

Proposition, favoris, offres postulees and alertes crees are anothers tables

image

I don’t know if I’m clear in my explanations😂

I just want the total of my table favoris, jobs and alert into my collection😅

Right, so I think this is a Supabase thing instead of a WeWeb one, as I can see that you’re familiar with objects and making dynamic elements in the editor.

https://supabase.com/docs/guides/database/functions

What you need is to have your server push a join of your datasets to your front-end. I am not exactly familiar with Supabase, but you can use SQL functions as per the documentation above.

Another shortcut could be to follow this thread from Joyce : 🎯 GET Data from Supabase. Look at the Advanced Mode in WeWeb which allows you to make custom queries to your supabase database.

Hopefully that can send you in the right track :slight_smile:

1 Like

Oh by the way! You could also use filterByKey to fetch only the data that you need when setting up repeating elements inside another dynamic element… silly me.

1 Like

Ooh really thank you !

That’s good with the filterByKey !

Thanks man ! :pray:

1 Like