Reusable Element Repeating Group Data Source constraining by url param of a DT that is a list of things

I have a reusable element that is a repeating group because it goes on several pages on my app.

It’s working as intended on some pages but I’m having trouble on one page - my material page which is the individual page for my Material data type.

My relevant data types are as follows.
Material: Material Name:Text
Projects: Material Txt: List of Texts

Material Txt is saved as Material Name in the DB via a Multidropdown. This is key because a project can have lots of materials.

The goal is to display all the projects for a particular material on that material page.

I’m using url parameters to pass data to my reusable elements.

My relevant url parameters are as follows:

page = materialpage
name = Material Name

I’m using conditions to change the data source of the repeating group via url.
“When Get page from URL is materialpage”
Data Source is…

This is where I’m running into trouble.

Search for Projects: Constrained by - Material Txt contains Get name from page URL

-----this only works when there is one Material in the list of texts.
If there is more than one list of text, it does not work at all.

I think the trouble comes from the ‘contains’ which apparently operates as an AND.

Attempting to follow this logic doesn’t work since I’m using a reusable element. I’ve added a hidden Multidropdown in my repeating group to try and use for the constraint but the logic wouldn’t let me.

I’m racking my brain to see how to get this to work.

Any thoughts?

Thanks!

There are two ways to get the data from URL, actually now there is three.

  1. URL parameters

  2. URL path

  3. URL path list

The URL path list is a new feature the bubble team rolled out when they did a hackathon last month.

I haven’t played around with it yet, but noticed you can do things like URL path list item #4 to get the fourth item from the list of paths in the URL

something like

www.myapp.com/products/t-shirts/small/red

could allow you to extract small from that list of paths.

This may help you somehow, especially if you know which item the material would be in the list of paths.

1 Like

I can see how that would be useful but I’m not sure it would apply here.

I’m thinking about creating new data fields under the Project Data type called Material Txt 1, Material Txt 2, Material Txt 3, …, Material Txt 10 - I can’t imagine I’d need more than 10.

Then saving one material in each one. I may not be able to use a multi drop down for that. And this may take a lot of work.

Then when constraining the data source on the repeating group on the material page, I could just put Material Txt 1 Material Txt contains Get name from page URL and repeat. I’d check ignore empty constraints.

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