queryContacts( )


Creates a query to retrieve a list of contacts.

The queryContacts() function builds a query to retrieve a list of contacts and returns a ContactsQueryBuilder 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 ContactsQueryBuilder functions onto the query. ContactsQueryBuilder functions enable you to sort, filter, and control the results queryContacts() returns.

queryContacts() runs with these ContactsQueryBuilder defaults, which you can override:

  • skip(0)
  • limit(50)
  • descending(\"_createdDate\")

The functions that are chained to queryContacts() are applied in the order they are called. For example, if you apply ascending('info.company') and then descending('info.name.last'), the results are sorted first by the company name, and then, if there are multiple results with the same company, the items are sorted by last name.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),in(),exists()
_createdDateeq(),ne(),gt(),lt(),ge(),le(),ascending(),descending()
_updatedDateeq(),ne(),gt(),lt(),ge(),le()
lastActivity.activityDateeq(),ne(),gt(),lt(),ge(),le(),ascending(),descending()
primaryInfo.emaileq(),ne(),in(),exists(),startsWith(),ascending(),descending()
primaryInfo.phoneeq(),ne(),in(),exists(),startsWith()
info.name.firsteq(),ne(),in(),exists(),startsWith(),ascending(),descending()
info.name.lasteq(),ne(),in(),exists(),startsWith(),ascending(),descending()
info.companyeq(),ne(),in(),exists(),startsWith(),ascending(),descending()
info.jobTitleeq(),ne(),in(),exists(),startsWith(),ascending(),descending()
info.birthdateeq(),ne(),ascending(),descending()
info.localeeq(),ne(),in(),exists()
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
Set Up Automations
Manage Members and Contacts - all permissions
Read Members and Contacts - all read permissions
Manage Contacts
Read Contacts
Manage Events
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
optionsQueryContactsOptions

Query contact options.

Returns
Errors
400Invalid Argument

There are 8 errors with this status code.

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

Did this help?