Search.../

items

Returns the items that match the query.

Description

The current page of items retrieved by the query.

List of labels.

Note: When no items match the query, the items array is empty.

To paginate your query results, use the LabelsQueryResult pagination properties and functions.

Type:

Array<Label>Read Only
NAME
TYPE
DESCRIPTION
key
string

Label key.

key is generated when the label is created and cannot be modified, even if displayName changes.

displayName
string

Label display name shown in the Dashboard.

labelType
string

Label type.

One of:

  • "SYSTEM": The label is a predefined system label for the Contact List.
  • "USER_DEFINED": The label was created by a site contributor or app.
  • "WIX_APP_DEFINED": The label was created by a Wix app.
_createdDate
Date

Date and time the label was created.

_updatedDate
Date

Date and time the label was last updated.

namespace
string

Label namespace.

Labels created by site contributors or 3rd-party apps are automatically assigned to the custom namespace.

Was this helpful?

Perform a query and get the returned items from the result

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { contacts } from 'wix-crm-backend';
3
4export const getQueryResultItems = webMethod(Permissions.Anyone, () => {
5 return contacts.queryLabels()
6 .limit(5)
7 .find()
8 .then((results) => {
9 if (results.items.length > 0) {
10 return results.items;
11 } else {
12 console.log("No items found");
13 }
14 })
15 .catch((error) => {
16 console.error(error);
17 });
18});
19
20/* items:
21 * [
22 * {
23 * "_createdDate": "2021-01-20T06:55:58.000Z",
24 * "displayName": "White Glove Treatment",
25 * "key": "custom.white-glove-treatment",
26 * "labelType": "USER_DEFINED",
27 * "namespace": "custom",
28 * "_updatedDate": "2021-01-20T06:55:58.000Z"
29 * },
30 * {
31 * "_createdDate": "2021-01-20T06:55:47.000Z",
32 * "displayName": "At Risk",
33 * "key": "custom.at-risk",
34 * "labelType": "USER_DEFINED",
35 * "namespace": "custom",
36 * "_updatedDate": "2021-01-20T06:55:47.000Z"
37 * },
38 * {
39 * "_createdDate": "2021-01-20T00:31:41.000Z",
40 * "displayName": "Active Customer",
41 * "key": "custom.active-customer",
42 * "labelType": "USER_DEFINED",
43 * "namespace": "custom",
44 * "_updatedDate": "2021-01-20T00:31:41.000Z"
45 * },
46 * {
47 * "displayName": "Customers",
48 * "key": "contacts.customers",
49 * "labelType": "SYSTEM",
50 * "namespace": "contacts",
51 * },
52 * {
53 * "displayName": "Contacted Me",
54 * "key": "contacts.contacted-me",
55 * "labelType": "SYSTEM",
56 * "namespace": "contacts",
57 * }
58 * ]
59 */