Search.../

items

Returns an array of services items that match the query.

Description

items contains the current page of results retrieved by the query. If no results match the query, items is an empty array. The page size is defined by the limit() function and can be retrieved using the pageSize property. You can use the next() and prev() functions returned by services to navigate the pages of a query result.

Type:

Array<
Service
>
NAME
TYPE
DESCRIPTION
_createdDate
Date

Date and time the service was created.

_id
string

Service ID.

_updatedDate
Date

Date and time the service was updated.

bookingPolicy
BookingPolicy

Policy determining under what conditions this service can be booked. For example, whether the service can only be booked up to 30 minutes before it begins.

category
V2Category

The category the service is associated with.

conferencing
Conferencing

Conferencing options for this service.

defaultCapacity
number

Default maximum number of customers that can book the service. The service cannot be booked beyond this capacity.

description
string

Service description, such as High-class hair styling, cuts, straightening and color.

extendedFields
ExtendedFields

Extensions enabling users to save custom data related to the service.

form
Form

The form used when booking the service.

hidden
boolean

Whether the service is hidden from the site.

locations
Array<
Location
>

The locations this service is offered at. In case of multiple (more than 1) location, All locations must be of type BUSINESS. For courses only: Currently, only 1 location is supported, for all location types.

mainSlug
Slug

The main slug for the service. mainSlug is either taken from the current service name or is a custom slug set by the business owner. mainSlug is used to construct the service's URLs.

media
Media

Media associated with the service.

name
string

Service name.

onlineBooking
OnlineBooking

Online booking settings.

payment
Payment

Payment options for booking the service.

revision
string

Revision number, which increments by 1 each time the service is updated. To prevent conflicting changes, the existing revision must be used when updating a service.

schedule
Schedule

The service's schedule, which can be used to manage the service's sessions.

seoData
SeoSchema

Custom SEO data for the service.

sortOrder
number

Order of a service within a category.

staffMemberIds
Array<
string
>

IDs of the staff members providing the service. For appointments only.

supportedSlugs
Array<
Slug
>

A slug is the last part of the URL address that serves as a unique identifier of the service. The list of supported slugs includes past service names for backwards compatibility, and a custom slug if one was set by the business owner.

tagLine
string

Short service description, such as Hair styling.

type
string

Service type.

Supported Values:

  • "APPOINTMENT"
  • "CLASS"
  • "COURSE"
urls
URLs

URLs to various service-related pages, such as the calendar page and the booking page.

Was this helpful?

Get items from a query result

Copy Code
1const returnedItems = results.items;
2
Perform a query and get items from the result

Copy Code
1import { services } from 'wix-bookings.v2';
2
3export async function myQueryFunction() {
4 const results = await services.queryServices().find();
5
6 const returnedItems = results.items;
7
8 if (returnedItems.length > 0) {
9 return items;
10 } else {
11 // Handle if no matching items found
12 }
13}
14