Individual popups from collection

Hey weweb community,

I’m fairly new to weweb and app design in general, but I’m slowly getting the hang of it, however, I am stuck on a popup issue; my goal is for the user to click on a card from a collection and a pop-up expands to reveal more data of only that item. So far I can’t figure out how to make the pop-up bring up data only relevant to the card that is clicked on, through either the modal or ‘link to popup’ options.

I assume I need to do some sort of formula/worflow but I so far can’t figure out how to set up that data fetch request. Any ideas?! Cheers for any help!

On your collection list, create a click event on the card.

Store the currently clicked item in a variable such as ‘selectedItem’ and open the popup.

In the popup, bind texts/elements to that ‘selectedItem’ variable.

Depending on your API setup, you might have all the information in the list response, otherwise you will need a separate collection fetch to a specific index, i.e. GET /item/{id}. You can bind the {id} to the ‘selectedItem.id’ variable.

Hope this helps!

Thanks Ajaw! It took me a long time to understand all the stupid things I was doing wrong but a mixture of your advice and two YouTube videos and I got there. My biggest mistake was confusing the variable type, ended up selecting it as an object and binding it directly to the collection ‘data’, from there it was easy to link everything up.

Thanks a lot!!

1 Like