Help creating categories

Hello guys!

I’m trying to create a catalog on my website. The idea is that people can search or clic some “cards” and then they will be redirected to another website with what they are looking for, but I don’t know how to do that.

I’m stuck with how to refresh the result page with what people is searching for, how can I do that?

Use the “display data” function in a workflow to show data in a repeating group. If you do a redirect, you can send data to the page and then just use it on a group.

1 Like

Hi ciyepiz,

If I’m understanding correctly, you have a dataset (multiple things). You’re showing all of them to the user, but want to give them the option to view a subset of those, based on keywords they searched for, correct?

One way to do this is to create a state on your repeating group and store your dataset for the group inside it. Then, when you do a search, set the repeating group state to your filtered dataset. Also, don’t forget to create a workflow for your page load event, setting the repeating group state to the full dataset. If you want to create a “clear search” workflow, you can do the same thing.

Hope that helps!

-Jon


1 Like

Hi Jon!

Thank you so much for your help. I don´t why I keep stuck on this, it seems easy at first haha.

Let me explain it better, I’m trying to create a “groupon-like” website, so I want to put coupons and promotions of different categories in the home page, you know, like Gastronomy, bars, events, etc.

I have managed to put the cards of places and general promotions, but when I want to be more specific and say “hey, here you can see some restaurant coupons” I don’t know how to program that on bubble.

Let me send you a screenshot of what I’m doing.

Hi ciyepiz, sorry for the slow reply, it’s been super busy. I’ve got an idea how you can do this, and will try to get it up here after work today.

1 Like

Thank you so much Jon, I really appreciate the time and effort you are taking to help me with my project.

Hi ciyepiz, once again, it’s been super busy, so sorry I haven’t been able to get to this. I’ve got some good news and bad news:

GOOD NEWS: I can walk you through creating tags and filtering on demand, so only coupons with the selected tag gets displayed!

BAD NEWS: I discovered I have a bug, so it only works if each coupon has ONE tag (for now - I’m working on a solution)

MAYBE that’s enough for what you need to accomplish (and I don’t want you to have to wait for me), so I’ll show you what I’ve worked up thus far…

So, what I’ve worked up will behave like this (only imaging there is 1 tag per coupon, instead of multiple):

I accomplished this by having a data type category, which is a simple list of text names for categories, and a data type offer which includes a List of Categories as one of the fields.

That data type setup lets me create a list of categories (i.e. tags, in this case), and associate any number of them with an offer data type. On the user-facing page, I’ve got 2 repeating groups - one is powered by a list of category names with a checkbox, and the other by a list of offers. On the category names repeating group, I’ve created a custom state that I’ve called Selected offers. It’s type is offer, and it is a list. The offers repeating group has the data source set to the category names repeating group custom state. In other words, I’m building a list of offers as a custom state on the categories, and displaying that list to the user in the other repeating group. Make sense so far?

From there I created a new workflow on “Elements” > “An inputs value is changed”:

I chose the checkboxes in the categories repeating group as the element to watch for change. From there I added an action, and selected “Element Actions” > “Set State”. I chose the “Selected offers” state on the category name repeating group and set the value to RepeatingGroup Category’s Selected Offers MERGED WITH Search for Offers. The …Search for Offers dialog is set to search for offers with the current cell category in the Categories list.

I’ve also set the “Only when” validation field to “This Checkbox is checked”.

To remove offers from the displayed list, I created another action, and selected “Element Actions” > “Set State”. I chose the “Selected offers” state on the category name repeating group and set the value to RepeatingGroup Category’s Selected Offers INTERSECTS WITH Search for Offers. The INTERSECTS condition takes two lists, compares them, and returns only the items that are present in BOTH. I’m removing the now undesired offers using …Search for Offers and searching everything that DOES NOT contain the category in the cell we just unchecked. Finally, I set the “Only when…” validation to “This Checkbox Isn’t Checked”.

I hope that all makes sense. It’s an interesting problem to solve, and I’m working on making it function as expected for multiple tags. Hopefully this will get you where you need to be, but I’ll post an update here regardless, once I’ve got this worked out.

-Jon

1 Like

Thank you so much for the tutorial! it has really helped me to better understand what mistakes I were making.
I’m going to try to do it just as you told me, thank you so much!