Question:
I’m using VELO trying to automatically find a course’s start date so I can set its price based on today’s date and if today is more than 7 days but less than 14 days ahead of the course start date. This needs to be done in the backend because I’m trying to use Wix Automation the run this automatically.
I’m having trouble even getting the start course date because I can’t find any documentation on where and how that is retrieved.
In Velo, you can retrieve the course start date by querying your database collection where course details are stored. Use wix-data in the backend to fetch the start date and compare it with today’s date. If today is 7-14 days before the start date, adjust the price accordingly. Make sure your function runs inside a backend web module so Wix Automations can trigger it. If you can’t find the correct field, check your database structure in Content Manager to ensure the start date is stored properly.
so I’ve queried for the service with the following code:
let result = await wixData.query("Bookings/Services").eq("_id", serviceId).find();
but how would i get the start date from the “result”?
I’ve also tried using getService like this:
import { services } from "wix-bookings.v2";
let result = await services.getService(serviceId);
but there is no field in the “result” that would allow me to retrieve the start date.
Documentation right here:
My main issue is not being able to find a function that can retrieve the start date of my service course.
we can discuss all your problems over a meet if you are interested
Could you just point me to the right documentation or just paste a pseudo code here on how you would approach getting the start date value? Thanks 