Seeking Advice on URL Parameters and Workflow for Reusable Elements

George is smart obviously, he’s been doing this for a long time.

Maybe you misunderstood.

It took me probably 3 or 4 days to figure this out. Yes, I’m a slow learner sometimes.

But, here’s how I’ve done it.

I have an option set that is -nav. In that, I have every group.

So, when I do a ‘get URL from page’ i choose a nav display.

Then, If I need to send data, I also do a ‘d’ which I use for display.

I send the current data to the group.

On the group I’m sending them to, I do a get ‘d’ from page url.

It is really hard to figure it out at first. But, after you get the hang of it, it’s easy.

It’s clear that there’s some confusion here. Thanks for your patience. I don’t understand how I can reference the current cell in “v” if I’m not using the current cell’s slug.

How do I match the current cell with a different option set than what is actually the current cell? Isn’t it essentially the same thing? Either I refer to the current cell’s slug, or I refer to another option set’s slug?

The URL updates with the v when I press it. So it obviously work. But I can´t show content with the condition: 'Get v from page URL is and then linking to the option.

Since the pressed tab shows the slug when I press it, I beige the error is in showing the content:

My options sets is Settings. One of the options is My profile and the slug is my-profile.

Wrong on both counts, I’ve been Bubbling properly for a year and a half, since December of 2022!

Your issue is that your condition is Get v from page URL is 02.1 My Profile, not Get v from page URL is 02.1 Profile 's slug

I’ll try and break it down a little more so you can understand how it works more:

  1. You have an option set for each tab, and each option has a ‘slug’ attribute that you’ve defined.
  2. You display these in a repeating group, and when a cell is clicked, you Go to page with v = Current cell’s option’s slug
  3. You want to show a reuseable element when a particular option is selected.
  4. You have a visibility condition. When a cell is clicked, we get v to the option’s slug. The option’s slug is a text.
  5. The visibility condition therefore needs to check if v (a parameter of type text) is equal to the relevant option’s slug.

I think you’re running into issues because your Get v from page URL is of the option type, when it should be text.

With your current setup:

  1. When my profile is clicked, v = my-profile
  2. Get v from page URL = my-profile
  3. my-profile is not 02.1 My Profile (an option), which is what your current condition checks
  4. my-profile is 02.1 My Profile’s slug (which you don’t have a condition set up for)
3 Likes

That worked! Oh my god, thanks. And sorry for being a bit slow…
So I still reference the current cell slug. But I changed the condition to be text.

Is there a way to do this dynamically? If I need to change the slug in the future, I would have to manually update each element with the new slug. This process seems inefficient.

Your expression should be Get v from page URL is 02.1 Profile 's slug, where v is type text.

2 Likes

Oh my! There I got it. It´s all in the details.

I owe you guys a beer! :beers:

3 Likes

I wanted to circle back to this as I was intrigued on whether this is a bug or not, as we know in the logs it is not a bug to see a different value compared to current display value of an option in the case where the display value is changed and expressed by Bubble as a known issue and considered expected behavior.

I did a test using the upload feature from the app editor, and if you upload a CSV with the current display value, it is properly mapped, even though the current display value is different from the original value when the option was created.

I then ran a test on the API connector and did an API call to create an entry in the database of another app, and in that case as well, the new display value of the option that is passed into the create API call will properly map to the option, even if that option display value was changed from it’s original value.

When I first read the response quoted, I read it as API connector and not app connector.

Now, I’m wondering if there is just a bug in the app connector that causes the issue, but I did not test the app connector (I’ve never used it and just use the API connector instead).

Do you experience the same issue if you use the upload feature from the app data section and/or when using the API connector and running a create API call?

Hello pros! Another question from me. How can/should I do this:

My menu has multiple levels based on OS:

•	Main
•	Sub (every sub has a main attribute)
•	Child (every child has a sub and a main attribute)

I have set up URLs for all subs now with v=Subs slug (e.g., settings).
Now, I need to set up all children with v=child’s slug (e.g., my-profile).

However, how can I get the child to include the slug from the sub so that the URL becomes something like: “pagename?v=settings/my-profile ?

At some places, there will be a shortcut to a Child, and in those cases, I can’t necessarily just send the current page parameters. I need to instruct it to include them.

:heart_eyes:

I haven’t tested in depth but I documented support’s response here:

1 Like

Ah yes, the dreaded known issue. Bubble should document those somewhere if they have not already…maybe a good way to implement some AI into bug reports.

Thanks for linking that post. I’m looking forward to playing around with app connector now.

For me, I just create an attribute that is related to the option set itself and label it as ‘parent option’.

So for example, I have Main, Sub, Child as display values. On Main ‘parent option’ attribute, it is empty, then on Sub the ‘parent option’ attribute is Main (not text but the actual option) and then on Child the ‘parent option’ attribute is Sub (again not text but the actual option).

I can then do things like Get all Options Filtered ‘this options parent is empty’ to get all of my Main options, then when an option is selected I can do Get all Options Filtered ‘this options parent is selected option’ to show all the sub options or child options.

This is something that will be unnecessary as the use of /is not something typically used in a URL parameter to separate a list of items in the parameter. You can check out my posts on how to use lists in URL parameters. The normal use case of such is for storing a list of values inside one URL parameter, and this use case of yours would not in my opinion fall into the category of when to use a list for URL parameters.

It seems like from your desired URL structure pagename?v=settings/my-profileyou are conflating the idea of a URL parameter and the URL path list.

URL path list is different from URL parameter. The path list would follow the page name, for example .com/stores/massachusetts/bostonis a proper path list and in that I can have .com/stores/massachusetts/boston?view=menuwhere I am properly using a path list for the location details to get the SEO benefits of that structure while my URL parameter is properly used to change the view of the page to showcase the menu of the store, which URL parameters would have nothing to do with SEO, and in some cases take away from it.

To be honest in my app I would have a structure of .com/stores/en/massachusetts/boston/luckysbar/menuas I’d be looking to get each of those pages indexed by Google, and do not want any URL parameters in the URL for SEO purposes. I have to track each item in the path list, where I would know that item#5 is store name, #6 is ‘view’ while #2 is language preference etc. I do this so that I can have an indexable page for .com/stores/en/massachusetts and .com/stores/sp/massachusettsthat would show all stores in massachusetts in English and the other in Spanish. But, URL path lists can be a bit of a challenge, and can not really be used if the page has content type set.

If you want to use URL parameters for your breadcrumb setup, not advisable but can be done, then use a separate URL parameter for the main option, the sub option and the child option so it would look like pagename?v=settings&s=my-profile&c=images

This will make it much easier to work with than trying to URL parameter as a list, and might be a bit easier to display the breadcrumb properly to the user as URL path list is sometimes difficult to track the different path list items and the order for which they would appear. And would be a better approach if the page for which the breadcrumb is to be has a content type set on the page, as we can not use the send data with text if the page has content type set.

1 Like

Thank you @boston85719 ! I’ll test some different approaches. I see that I can use a path if I set a specific page as the destination, but not if I set it to the current page.

In my case, my menu is in a reusable element, so the destination must be the current page. However, how can I set the data to send in this scenario? Or is it not possible to use a path from a reusable element and I must use URL parameters instead?


Yes, that is a problem with most of the new features bubble releases…they are not fully realized features and after release they rarely put all of the user feedback into practice to help the features be more usable.

1 Like

SO the only way to get paths is to use Go to external website in the workflow then?

I see that the whole page updates when I navigate with Go to externalwebsite

Is it possible to this without a refresh?

No. Don’t use that. Better off using conditionals on the go to page action to determine which page to go to and be able to access the data to send. Set up a custom trigger, one for each page. On the click to text to navigate trigger the custom triggers with conditions using page name is…

Okay, so instead of using “Go to,” I set the state and display content based on that state. But where do I add the information about the path in this case?

No, instead of using current page or dynamic page, set up a custom trigger with an action for go to page, one for each page. Then on click of text, run action to trigger the custom triggers, with the condition for when current page name is the page that belongs to the custom trigger

Sorry, I’m a slow learner.

Do you have any screenshots or examples?

Let’s say I have a page called /profile. I have already set up the workflow so that when someone navigates to this page, the path /current-users-slug is appended to the URL, making it look like this: my-page.com/profile/firstname-lastname.

On this page, I have a tab menu (Reusable Element) that fetches content based on option sets (My Profile/Security/Notification/Privacy).

As I understand it, I should set up my workflow to handle each option set I want to display in the tab menu like this:

1.	Go to page profile
2.	Data to send: Current User’s slug / (how do I add e.g Security´s slug here?)
3.	Only when Current Cell’s Option Set is Security
4.	Set state: security

Based on the active state or the path, I can show the relevant content. But how do I append security after the current user’s slug in the data to send? And, what am I missing with the Custom State?

I do not know

Use arbitrary text and send in the appropriate value from the option set the user would have been clicking

1 Like

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