queryServices( )


Creates a query to retrieve a list of service objects.

The queryServices() function builds a query to retrieve a list of service objects and returns a ServicesQueryBuilder object.

The returned object contains the query definition, which is typically used to run the query using the find() function.

You can refine the query by chaining ServicesQueryBuilder functions onto the query. ServicesQueryBuilder functions enable you to sort, filter, and control the results that queryServices() returns.

queryServices() runs with the following ServicesQueryBuilder defaults that you can override:

  • limit is 100.
  • Sorted by createdDate in ascending order.

The functions that are chained to queryServices() are applied in the order they are called. For example, if you apply ascending("category.name") and then ascending("name"), the results are sorted first by category.name, and then, if there are multiple results with the same category.name, the items are sorted by name.

The following ServicesQueryBuilder functions are supported for the queryServices() function. For a full description of the service object, see the object returned for the items property in ServicesQueryResult.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),exists(),in(),hasSome(),startsWith()
typeeq(),ne(),exists(),in(),hasSome()
nameeq(),ne(),exists(),in(),hasSome(),startsWith()
descriptioneq(),ne(),exists(),in(),hasSome(),startsWith()
tagLineeq(),ne(),exists(),in(),hasSome(),startsWith()
hiddeneq(),ne(),exists(),in(),hasSome()
category.ideq(),ne(),exists(),in(),hasSome(),startsWith()
category.nameeq(),ne(),exists(),in(),hasSome(),startsWith()
form.ideq(),ne(),exists(),in(),hasSome(),startsWith()
payment.options.onlineeq(),ne(),exists(),in(),hasSome()
payment.options.inPersoneq(),ne(),exists(),in(),hasSome()
payment.options.pricingPlaneq(),ne(),exists(),in(),hasSome()
onlineBooking.enabledeq(),ne(),exists(),in(),hasSome()
locations.business.ideq(),ne(),exists(),in(),hasSome(),startsWith()
schedule.firstSessionStarteq(),ne(),exists(),in(),hasSome(),lt(),le(),gt(),ge()
schedule.lastSessionEndeq(),ne(),exists(),in(),hasSome(),lt(),le(),gt(),ge()
staffMemberIdseq(),ne(),exists(),in(),hasSome(),hasAll()
supportedSlugs.nameeq(),ne(),exists(),in(),hasSome(),startsWith()
mainSlug.nameeq(),ne(),exists(),in(),hasSome(),startsWith()
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
Method Parameters
optionsQueryServicesOptions
Returns

Query services without any filters. The defaults are a limit of 100, and an offset of 0.

JavaScript
Errors

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

Did this help?