queryLabels( )


Creates a query to retrieve a list of labels.

The queryLabels() method builds a query to retrieve a list of labels and returns a LabelsQueryBuilder object.

The returned object contains the query definition, which is used to call the query using the find() method.

You can refine the query by chaining LabelsQueryBuilder methods onto the query. LabelsQueryBuilder methods enable you to filter, sort, and control the response that queryLabels() returns.

queryLabels() is called with the following LabelsQueryBuilder defaults, which you can override:

  • skip(0)
  • limit(50)
  • descending('_createdDate')

The following LabelsQueryBuilder methods are supported for queryLabels(). For a full description of the Labels object, see the object returned for the items field in LabelsQueryResult.

PROPERTYSUPPORTED FILTERS & SORTING
namespaceeq(),ne()
keyeq(),ne(),in()
displayNameeq(),ne(),in(),startsWith(),ascending(),descending()
labelTypeeq()
_createdDateeq(),ne(),gt(),lt(),ge(),le(),ascending(),descending()
_updatedDateeq(),ne(),gt(),lt(),ge(),le(),ascending(),descending()
Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Bookings Services and Settings
Manage Contact Labels
Manage Events
Manage Portfolio
Access Verticals by Automations
Set Up Automations
Manage Restaurants - all permissions
Manage Members and Contacts - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
optionsQueryLabelsOptions

Language options.

Returns
Return Type:LabelsQueryBuilder
Errors
400Invalid Argument

There are 6 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?