Update image inside collection popup

Hi Weweb folks !

Thank you for this wonderful life hack that you are building!

I would love to know how to :

  • Update from a collection the image that’s inside a popup (which is also generated from a collection).

As you can see I’ve set the thing correctly (I hope so :sweat_smile: ) but when I change to another popup the same image appears!

Thank you very much!

Peace :vulcan_salute:

Hi Sofiane! Glad you’re enjoying WeWeb! :slight_smile:

Could you share a link to the editor so I can check it out?

Good Morning Joyce :grin:

Something like this ?

Thanks for your reactivity! :heart_decoration:

Hi Sofiane!

Just had a look in the editor and added a “Services test” page where you can see the image update correctly depending on the service that was clicked on.

Will share screenshots and explanations shortly :slight_smile:

Step 1 – Create an Empty Variable

The first thing I did is create an empty variable called selectedService:

The variable type is an object because we will want to add all the information from the item we select.

We leave it empty by default because no service is selected by default.

Step 2 – Create a Workflow to Add Information to the Variable Based on the Selected Item

The second thing I did is create a workflow called Select Service on the icon that the user can click on to make the popup appear.

The trigger is On Click because the workflow starts when the user clicks on the icon.

The variable we want to change is the selectedService variable (which is empty by default).

We want the whole data from the selected item to be the new value of this selectedService variable.

Bind the Image to the selectedService Variable

Finally, in the popup, we bound the image to our selectedService variable that includes all the information from the selectedService.

The tricky part was to find where the image URL was stored in the variable and it turns out it’s the third item in variable, so index 2 in code speak.

Ok, I hope that helped! It was fun looking! :grinning:

If anything is unclear or doesn’t work as intended, don’t hesitate to let us know!! :slight_smile:

1 Like

:exploding_head:

You are a gem Joyce ! Brilliant !

Thank you very much, it’s crystal clear.

:heart_eyes:

1 Like