Forum Academy Marketplace Showcase Pricing Features

Having page load run when using parameter in URL

Hi!

I have a problem when creating a specific URL for my users. I want to create rooms for people to collaborate on projects. But the admin should be able to decide if he wants his room to be “private” or “public”.

So when people use the specific URL of the room, if it’s private and they are not logged in and invited, they should be redirected.

It works when I use the unique ID of the room after the URL Le modèle 10* d'Airbnb but not when I use the the key ?idsalle like this Le modèle 10* d'Airbnb.

You can test it the room is currently private, so you should be redirected but when you use the second instance, you are able to see the room.

I found a way to make it work but could someone explain what the difference is between the 2 URLs ?

Thanks in advance !
Julie

When you set a type of content on the page the way Bubble will display the correct entry from the database is to look at either the unique ID or slug of that entry which would be found in the URL as a path after the page name (paths are speparted by a “/” in the URL).

The second method you tried was using a parameter which is separated by a ? for the first parameter and a & for each additional parameter.

When using the parameter you need to tell Bubble what the data type is when using the Get data from URL method.

Thanks for the super quick response!

Here’s how I’m using “get data from the URL”


What I don’t understand is that it works because for both instances I end up in the right “room” but in one case the workflow set for when page is loaded doesn’t trigger.

The dynamic expression you are using is how I first setup my dynamic expressions for get data from URL…now, and I literally just two days ago made these changes in an older app of mine, instead of doing a search for a thing with constraint of unique = get data from URL (parameter)

I use the Get data from URL (parameter) and set the type to whatever datatype I had previously searched. If your parameter value is a unique id of that datatype, they will recognize the unique as the parameter value to get the exact entry from the database without needing to do a search.

For your expression it would be 'get data from URL parameter (idsalle) type = 00_Salless

I have no idea how you have that setup…if that is the main question please share some screen shots of how that is setup and for which case the workflow works and the case the workflow doesn’t work.

Great tip! I set it that way and it works perfectly and is obviously much more simple!

About the other issue, I cleaned everything and made sure my logic was correct. Guess what? It now works fine for both.

Anyway, thanks a lot! Do you know other examples where you can replace the search for?

Using the current page thing…setting the content type on the page (Bubble uses the same logic to display)