queryServiceOptionsAndVariants( )


Creates a query to retrieve a list of serviceOptionsAndVariants objects.\n\nThe queryServiceOptionsAndVariants() function builds a query to retrieve a list of serviceOptionsAndVariants objects and returns a ServiceOptionsAndVariantsQueryBuilder object.\n\nThe returned object contains the query definition, which is typically used to run the query using the find() function.\n\nYou can refine the query by chaining ServiceOptionsAndVariantsQueryBuilder functions onto the query. ServiceOptionsAndVariantsQueryBuilder functions enable you to sort, filter, and control the results that queryServiceOptionsAndVariants() returns.\n\nqueryServiceOptionsAndVariants() runs with the following ServiceOptionsAndVariantsQueryBuilder default that you can override:\n\n+ limit is 50.\n+ Sorted by id in ascending order.\n\nThe functions that are chained to queryServiceOptionsAndVariants() are applied in the order they are called. For example, if you apply ascending("options.values.type") and then ascending("variants.values.price"), the results are sorted first by the "type", and then, if there are multiple results with the same "type", the items are sorted by "price".\n\nThe following ServiceOptionsAndVariantsQueryBuilder functions are supported for the queryServiceOptionsAndVariants() function. For a full description of the serviceOptionsAndVariants object, see the object returned for the items property in ServiceOptionsAndVariantsQueryResult.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),in(),ne(),ascending(),descending()
serviceIdeq(),in(),ne(),ascending(),descending()
options.valuesexists()
options.values.idhasSome()
options.values.typehasSome()
variants.valuesexists()
variants.values.choices.customhasSome()
variants.values.choices.optionIdhasSome()
variants.values.price.valuehasSome()
variants.values.price.currencyhasSome()
Permissions
Manage Bookings Services and Settings
Manage Bookings - all permissions
Read Bookings - all read permissions
Manage Bookings
Read Bookings - Public Data
Read Bookings - Including Participants
Learn more about app permissions.
Method Declaration
Copy
function queryServiceOptionsAndVariants(): ServiceOptionsAndVariantsListQueryBuilder;
Request
This method does not take any parameters
JavaScript
import { serviceOptionsAndVariants } from "@wix/bookings"; async function queryServiceOptionsAndVariants() { const { items } = await serviceOptionsAndVariants .queryServiceOptionsAndVariants() .find(); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?