Dear Corvid community,
I am trying to connect my Wix website to an application that generates virtual keys and I would hence need to find a way to “extract” from the system the following data for each booking:
- user ID
- name of service
- location of the booking
- date and time of the booking.
Basically this needs to happen every time a user books a service.
I know that each user can see this data on the “my bookings” page. And I also know I can see it myself under “Members’ area”, clicking on manage I can see both next bookings and history.
I need to call this internally in the code in order to generate an input.
Does any of you know how to do this? I cannot find this data anywhere, tried to create a collection but it is not possible.
Thank you in advance!
Francesca
Here is the Bookings documentation . Hopefully you can find what you’re looking for there.
Hi Yisrael ,
I need to get first element in my dataset, but when I try to get my first Item, it returns the first Booking/Service.:
$w( “#dataset1” ).getItems( 0 , 1 )
.then( (result) => {
console.log(result);
} );
How can I access the first data booking item ?
Thank you in advance!
You probably need to set the sort order, or set a filter to retrieve the appropriate entries. Otherwise, getItems() doesn’t know what items you want.
Hi Yisrael,
this is my code:
$w( “#dataset1” ).setSort(wixData.sort().descending( “date” ))
.then( () => {
console.log( “Dataset is now filtered” );
$w( “#dataset1” ).getItems( 0 , 1 )
.then( (result) => {
console.log(result);
} )
} )
. catch ( (err) => {
console.log(err);
} );
The result is the same,:
The dataset is connected to Schedule dataset.
I want access my first scheduled booking, but maybe I’m doing something wrong .