Using a Repeating Group's Current Cell's Field to Display all Items in Another Page

Hello! I’m building an app where I’ve added a few sample products, each of which have a product category column in the “Products” dataset, see screenshot.

In my app home page called “test”, I’m using a repeating group to display each of the product categories in the products dataset. The data source for this repeating group is a simple search for products. Using dynamic data, the product category appears as the current cell’s product’s category.

image

Once I click on the image or the product category text, I would like to navigate to a new page with all of the products listed for the clicked category. For example, if I click Safety, there are two products (Pair of Gloves, Glasses) I would like to see listed in the new page.

I have built the workflow to navigate to the new page called “items_by_category” however this is where I get stuck. In “Data to Send” for the “test” workflow, I would like to send the Current Cell’s Product’s Category to “items_by_category” so I can see all the products under the selected category. I plan to have many more categories and products in the long run.

Any ideas on how to achieve this? I’m open to using a different visual element if a repeating group is not the way in “items_by_category”. Much thanks for the ideas.

As an additional note, I have tried sending just the current cell’s product to a repeating group in “items_by_category” but this of course will just repeat the products in the category I send. Ultimately, I would like to display all of the products with this highlighted category.

Hi there,

This is the approach I’d recommend experimenting with - create a page called ‘Search’. On your repeating group of categories, set it to ‘Go to Page → Internal Page → Search’. Send additional parameters: category = current cell’s Category.

Now on your page Search, place a Repeating Group. Set it’s data to type “Products”. Data source is Do A Search for “Products”. Add a constraint “Category” = Get Data from URL → category.

Now when a user clicks on a category, it will go to the Search page with a URL of /search?category=Safety . On that page the repeating group will display all products with a matching Category.

I hope this helps!

@msgiblin Thank you very much for your help! It works :grinning:
I’ll keep the article below in my back pocket as there seems to be good documentation in here as well: URL parameters | Bubble Docs

1 Like

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