URL changing on page load

I’m trying to use a username in the URL, but the url keeps resetting when the page loads.

The page is set to content type user, and when I open it in preview for the first time it shows demo:user, but as soon as it loads demo:user is removed. The same thing happens with a user’s username.

For example: I am trying to open the URL https://*********.bubbleapps.io/version-test/booking/chris?debug_mode=true&tab=1

But what opens is: https://*******.bubbleapps.io/version-test/booking?debug_mode=true&tab=1

There is something removing the username on load and I’m having a hard time trying to find it.

Any help would be greatly appreciated. Thanks!

Hello @chriskbetancourt welcome to the forum!

Try setting the page to no type.

Load the user via a custom state of type user on page load. You can then use it for the page’s purposes.

A Canvas best practice instead of a custom state would be to add the user on the hidden variables popup that most Canvas pages and reusables have.

This is about setting up a group of type user, naming it “var page user” and search for him/her.

Then you can user “var page user” on the different expressions needed on your page … with the additional benefit of being able to apply conditions if needed (that cannot be done with custom states).

Hey @cmarchan !

Thanks for taking the time to reply. I really appreciate it.

I’m a bit new with canvas/bubble still, so I’m a bit confused and I might be explaining this incorrectly.

My original goal was to use the username in the url so that

  1. The user can share that booking page with people
  2. I was planning on setting dynamic data based on the username in the url

For example, the main user shares the page with their username in it (booking/chris), and to show services I was going to use “do a search for” —> services → username = get path from url to show the correct services

I’m most likely completely misunderstanding what you’re saying, but if I set the user through a custom state on page load, wouldn’t the user have to be logged in so I can use “current user”, or how would “page user” know which username it should use.

Is there a way to stop canvas from changing the URL from booking/chris?tab=1 to just booking?tab=1

I’ve been able to do this before when building an app from scratch, but with canvas something is changing the URL.

Thanks again!

Hello @chriskbetancourt

How about slugs?