sessionID availability on Booking Form page

On our Booking Form page, I want to add some Velo code to add more information about the session being booked. Is there some object that I can access that holds the Session ID so that I can query and display that information?

Hello! You can write backend code to create the session using createSession. This will return an object that includes the session ID, which you can store somewhere else. To display a queried session’s data using its ID, you can use getSession or querySessions .

I don’t want to create a session. The session already exists. The user got to the Booking Form by selecting a specific session. I just want to get the ID of that session.

If you’re looking to use the built-in Booking Form, you’ll likely need to use querySessions - Velo API Reference - Wix.com to query the sessions, and find the one you’re looking for which will also provide the session ID.

The one I’m looking for is the one that was used to launch the Booking Form. How would I go about querying for that session?

Clearly, that sessionId is available somewhere. The Daily Agenda or Booking Calendar element on the previous page launched the Booking Form page. It somehow passed the selected sessionId to that page. The Booking Form element on that page somehow gets the sessionId so that it can display the time, location, staff, etc., and create a booking for that session.

It seems logical that if the sessionId is available to the Booking Form element, it should be available to my JavaScript code for the page. Wix storage? Wix location? Something else?

We actually just released a feature allowing you to swap out the Booking Calendar and/or Services page for your own. Perhaps this will help with what you’re hoping to achieve - Replace standard Wix app pages with your own custom version

Would be awesome to know a little bit more about what you’re trying to achieve to help point you in the right direction :slight_smile:

I’m not sure this helps, but I’ll take a look.

My immediate goal is to add an element on the Bookings Form page that displays a list of the names of those already signed up. It would be easy if I could have access to the sessionId.

There are other things I’d like to do to customize standard Wix pages, but those would be topics for other questions.

I don’t necessarily want to create a custom Booking Form page, just add a new element to the standard page. Is there any chance I can call getAppPageData() to retrieve the session object while on that page?

Also, do you need to have a custom page in order to use this function, or can you use it to augment the standard page?

I see that I can create a link to a preloaded booking form by adding query parameters to the URL. That includes a parameter for bookings_sessionId. That’s useful. However, when I check wixLocationFrontend.query for the Bookings form loaded from our regular booking schedule page, it does not seem to include that query parameter? Is this available?