One page app get data from URL, different type of data types?

Hello, I’m stuck on something and can’t figure it out. I have a one-page app with different “pages” based on the URL.
For example:

  • www.mysite.com/app/company/apple (company view)

  • www.mysite.com/app/employees/erik (employee view)

The problem is that no data is showing up on the employee page/group. I’m trying to “Get data from URL (item #3: employee)” but it still returns nothing. I don’t think it’s a privacy issue just that I’m missing something in the setup.

I can’t seem to display any data from URL


After a few hours i finally sorted it out, not sure tho if this is the best / correct way? or if im using unnecessary WU this way? (get data from page URL is TEXT)

You can use “get data from page url”, write the name of the url and what data you’re expecting(probably the data of the url you want to pull)

This is how I’ve set up my SPA, months ago. I’m using the methodology to get the path text and search. Works reliably.
The only difference being, ‘m using integer IDs vs Slugs.

1 Like

If it works, it is correct, but in my opinion it is not the best

This is the way. Bubble gives by default the ‘type’ as text, but that is a drop down (I think many many many developers never clicked it) and it opens up a list of all data types. So select the type of data it is.

In your URL parameter you need the unique ID it it is a custom data type, or the display value if it is an option set. Bubble will pull up the correct entry/option and if it is a custom data type, it is an individual data request, so a charge of 0.015 WUs.

1 Like

Right, that makes good sense. I’m not using URL parameters but just the path… This is what I understand OP is trying too.

It’s certainly not WU friendly but gives a clean URL.

1 Like

Sorry, I didn’t even see that. Then that search setup is the most WU efficient way. Because it is slug, it is slightly less efficient than unique id, but the difference is not worth the tradeoff of needing to use the unique ID instead of slug within the url path.

1 Like

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