hasSome( )


Refines a query to match items whose specified property value contains any of the specified values.

The hasSome() function refines a ContactsQueryBuilder to only match items where any of the values of the array of the specified property equal any of the specified values.

Matching with hasSome() is case-sensitive in most instances, so "text" is not equal to "Text". One exception is email fields, which are case insensitive when matching with hasSome().

Method Declaration
Copy
function hasSome(
  propertyName: string,
  values: Array<string>,
): ContactsQueryBuilder;
Method Parameters
propertyNamestringRequired

The property whose value will be compared with value.

Supported properties:

  • "_id"
  • "primaryInfo.email"
  • "primaryInfo.phone"
  • "info.name.first"
  • "info.name.last"
  • "info.emails.email"
  • "info.phones.phone"
  • "info.addresses.street"
  • "info.addresses.city"
  • "info.addresses.subdivision"
  • "info.addresses.country"
  • "info.company"
  • "info.jobTitle"
  • "info.locale"
  • "info.labelKeys"

valuesArray<string>Required

The values to match against.

Returns
JavaScript
const query = contacts .queryContacts() .hasSome("info.extendedFields.members.membershipStatus", [ "APPROVED", "DENIED", "PENDING", "INACTIVE", ]);
Errors

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

Did this help?