Search...
items
Returns the items that match the query.
Description
The current page of items retrieved by the query.
List of contacts.
Note: When no items match the query, the items array is empty.
To paginate your query results, use the ContactsQueryResult
pagination properties and functions.
Type:
Array<Contact>Read Only
NAME
TYPE
DESCRIPTION
_id
string
Contact ID.
revision
number
Revision number, which increments by 1 each time the contact is updated.
To prevent conflicting changes,
the existing revision
must be used when updating a contact.
source
Source
Details about the contact's source.
_createdDate
Date
Date and time the contact was created.
_updatedDate
Date
Date and time the contact was last updated.
lastActivity
LastActivity
Details about the contact's last action in the site.
primaryInfo
PrimaryInfo
Contact's primary phone and email.
info
Info
Contact's details.
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';34export const getQueryResultItems = webMethod(Permissions.Anyone, () => {5 return contacts.queryContacts()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});1920/* items:21 * [22 * {23 * "_id": "a52852d7-e0d6-484b-93fe-bffdb670f08f",24 * "_createdDate": "2021-03-30T20:18:06.874Z",25 * "_updatedDate": "2021-03-31T00:10:13.607Z",26 * "revision": 3,27 * "info": {28 * "name": {29 * "first": "Ari",30 * "last": "Thereyet"31 * },32 * "picture": {},33 * "emails": [34 * {35 * "_id": "e6f2733e-32b8-4d99-95ce-7d2e63a39108",36 * "tag": "HOME",37 * "email": "ari.thereyet@example.com",38 * "primary": true39 * },40 * {41 * "_id": "703f6faf-7d88-42ce-8e28-54f8d5f6e5e4",42 * "tag": "UNTAGGED",43 * "email": "ari.thereyet.appended.email@example.com",44 * "primary": false45 * }46 * ],47 * "phones": [48 * {49 * "_id": "970380bb-57e0-4b3a-8f40-ccc93be1ab58",50 * "tag": "MOBILE",51 * "phone": "601-081-124",52 * "primary": true53 * }54 * ],55 * "labelKeys": [56 * "custom.stale-lead"57 * ],58 * "extendedFields": {59 * "contacts.displayByLastName": "Thereyet Ari",60 * "emailSubscriptions.deliverabilityStatus": "NOT_SET",61 * "emailSubscriptions.subscriptionStatus": "NOT_SET",62 * "emailSubscriptions.effectiveEmail": "ari.thereyet.appended.email@example.com",63 * "contacts.displayByFirstName": "Ari Thereyet"64 * }65 * },66 * "lastActivity": {67 * "activityDate": "2021-03-30T20:18:06.872Z",68 * "activityType": "CONTACT_CREATED"69 * },70 * "primaryInfo": {71 * "email": "ari.thereyet@example.com",72 * "phone": "601-081-124"73 * },74 * "source": {75 * "sourceType": "WIX_APP"76 * }77 * },78 * {79 * "_id": "bc0ae72b-3285-485b-b0ad-c32c769a4daf",80 * "_createdDate": "2021-03-30T13:12:39.650Z",81 * "_updatedDate": "2021-03-30T13:12:39.650Z",82 * "revision": 0,83 * "info": {84 * "name": {85 * "first": "Gene",86 * "last": "Lopez"87 * },88 * "company": "Borer and Sons, Attorneys at Law",89 * "birthdate": "1981-11-02",90 * "jobTitle": "Senior Staff Attorney",91 * "locale": "en-us",92 * "picture": {93 * "image": "https://randomuser.me/api/portraits/men/0.jpg",94 * "imageProvider": "EXTERNAL"95 * },96 * "emails": [97 * {98 * "_id": "5bdcce4a-37c2-46ed-b49c-d562c6e3c4ce",99 * "tag": "HOME",100 * "email": "gene.lopez.at.home@example.com",101 * "primary": true102 * },103 * {104 * "_id": "78e5f398-e148-448d-b490-7c0b7d2ab336",105 * "tag": "WORK",106 * "email": "gene.lopez@example.com",107 * "primary": false108 * }109 * ],110 * "phones": [111 * {112 * "_id": "820e4640-ffe0-4980-a097-62a715e73135",113 * "tag": "MOBILE",114 * "countryCode": "US",115 * "phone": "(722)-138-3099",116 * "primary": true117 * },118 * {119 * "_id": "8506549e-e4f8-42f6-b6fc-9db155b582ef",120 * "tag": "HOME",121 * "countryCode": "US",122 * "phone": "(704)-454-1233",123 * "e164Phone": "+17044541233",124 * "primary": false125 * }126 * ],127 * "addresses": [128 * {129 * "address": {130 * "formatted": "9834 Bollinger Rd\nEl Cajon, WY 97766\nUS",131 * "location": {132 * "latitude": 84.1048,133 * "longitude": -116.8836134 * },135 * "city": "El Cajon",136 * "subdivision": "US-WY",137 * "country": "US",138 * "postalCode": "97766",139 * "streetAddress": {140 * "name": "Bollinger Rd",141 * "number": "9834",142 * "apt": ""143 * }144 * },145 * "_id": "8532051f-91f2-42d9-9a97-9f2c39e64f7a",146 * "tag": "HOME"147 * }148 * ],149 * "labelKeys": [150 * "custom.white-glove-treatment",151 * "contacts.contacted-me",152 * "custom.new-lead"153 * ],154 * "extendedFields": {155 * "contacts.displayByLastName": "Lopez Gene",156 * "emailSubscriptions.deliverabilityStatus": "NOT_SET",157 * "emailSubscriptions.subscriptionStatus": "NOT_SET",158 * "custom.event-we-met-at": "LegalBigData",159 * "emailSubscriptions.effectiveEmail": "gene.lopez.at.home@example.com",160 * "contacts.displayByFirstName": "Gene Lopez"161 * }162 * },163 * "lastActivity": {164 * "activityDate": "2021-03-30T13:12:39.649Z",165 * "activityType": "CONTACT_CREATED"166 * },167 * "primaryInfo": {168 * "email": "gene.lopez.at.home@example.com",169 * "phone": "(722)-138-3099"170 * },171 * "source": {172 * "sourceType": "OTHER"173 * }174 * },175 * {176 * "_id": "41b1c8e7-5ddd-4186-ad85-269985d6b296",177 * "_createdDate": "2021-03-29T21:16:54.801Z",178 * "_updatedDate": "2021-03-30T20:14:16.256Z",179 * "revision": 3,180 * "info": {181 * "name": {182 * "first": "Renata",183 * "last": "Kirsten"184 * },185 * "picture": {},186 * "emails": [187 * {188 * "_id": "500569e4-144d-4f25-83a1-4a59956b698d",189 * "tag": "UNTAGGED",190 * "email": "renata.kirsten@example.com",191 * "primary": true192 * }193 * ],194 * "phones": [195 * {196 * "_id": "3ea63681-598a-45bc-88fb-97fefdfd5a74",197 * "tag": "UNTAGGED",198 * "phone": "0177-3234750",199 * "primary": true200 * }201 * ],202 * "addresses": [203 * {204 * "address": {205 * "formatted": "6677 Schlossstraße\n48435 Wittenberg\nGermany",206 * "city": "Wittenberg",207 * "subdivision": "DE-TH",208 * "country": "DE",209 * "postalCode": "48435",210 * "addressLine1": "6677 Schlossstraße"211 * },212 * "_id": "b36d1a2d-9a6b-48c3-a463-c8b116303e9f",213 * "tag": "SHIPPING"214 * },215 * {216 * "address": {217 * "formatted": "6677 Schlossstraße\n48435 Wittenberg\nGermany",218 * "city": "Wittenberg",219 * "subdivision": "DE-TH",220 * "country": "DE",221 * "postalCode": "48435",222 * "addressLine1": "6677 Schlossstraße"223 * },224 * "_id": "2a3fc791-cbad-4ecd-8bf6-8072b2793e3a",225 * "tag": "BILLING"226 * }227 * ],228 * "labelKeys": [229 * "contacts.customers"230 * ],231 * "extendedFields": {232 * "contacts.displayByLastName": "Kirsten Renata",233 * "emailSubscriptions.deliverabilityStatus": "NOT_SET",234 * "ecom.lastPurchaseDate": "2021-03-29T21:17:01.122Z",235 * "ecom.numOfPurchases": 1,236 * "emailSubscriptions.subscriptionStatus": "NOT_SET",237 * "ecom.totalSpentAmount": 120,238 * "emailSubscriptions.effectiveEmail": "renata.kirsten@example.com",239 * "contacts.displayByFirstName": "Renata Kirsten",240 * "ecom.totalSpentCurrency": "ILS"241 * }242 * },243 * "lastActivity": {244 * "activityDate": "2021-03-29T21:17:01.122Z",245 * "activityType": "ECOM_PURCHASE"246 * },247 * "primaryInfo": {248 * "email": "renata.kirsten@example.com",249 * "phone": "0177-3234750"250 * },251 * "source": {252 * "appId": "1380b703-ce81-ff05-f115-39571d94dfcd",253 * "sourceType": "WIX_STORES"254 * }255 * },256 * {257 * "_id": "67bcea88-b748-4cc8-a584-bb991b6e5d82",258 * "_createdDate": "2021-03-29T21:06:53.976Z",259 * "_updatedDate": "2021-03-29T21:06:53.976Z",260 * "revision": 0,261 * "info": {262 * "name": {263 * "first": "Ljiljana",264 * "last": "Francois"265 * },266 * "birthdate": "1981-09-13",267 * "jobTitle": "Creative Director",268 * "company": "Happy Mouse Productions",269 * "locale": "en-us",270 * "emails": [271 * {272 * "_id": "c030ed4c-e127-4f02-8256-8984415e0321",273 * "tag": "MAIN",274 * "email": "ljiljana.francois@example.com",275 * "primary": true276 * }277 * ],278 * "picture": {},279 * "extendedFields": {280 * "contacts.displayByLastName": "Francois Ljiljana",281 * "emailSubscriptions.deliverabilityStatus": "NOT_SET",282 * "emailSubscriptions.subscriptionStatus": "NOT_SET",283 * "emailSubscriptions.effectiveEmail": "ljiljana.francois@example.com",284 * "contacts.displayByFirstName": "Ljiljana Francois"285 * }286 * },287 * "lastActivity": {288 * "activityDate": "2021-03-29T21:06:53.975Z",289 * "activityType": "CONTACT_CREATED"290 * },291 * "primaryInfo": {292 * "email": "ljiljana.francois@example.com"293 * },294 * "source": {295 * "sourceType": "OTHER"296 * }297 * },298 * {299 * "_id": "1626081c-3b3c-4b44-855b-1acb1122e080",300 * "_createdDate": "2021-03-29T20:51:21.216Z",301 * "_updatedDate": "2021-03-30T11:50:42.040Z",302 * "revision": 6,303 * "info": {304 * "name": {305 * "first": "Celine",306 * "last": "Rousseau"307 * },308 * "locale": "en",309 * "picture": {},310 * "emails": [311 * {312 * "tag": "UNTAGGED",313 * "email": "celine.rousseau@example.com",314 * "primary": true315 * }316 * ],317 * "phones": [318 * {319 * "tag": "UNTAGGED",320 * "phone": "0177-7912572",321 * "primary": true322 * }323 * ],324 * "addresses": [325 * {326 * "address": {327 * "formatted": "2451Rue des Cuirassiers\n9502 Grosshöchstetten\nSwitzerland",328 * "city": "Grosshöchstetten",329 * "subdivision": "CH-VD",330 * "country": "CH",331 * "postalCode": "9502",332 * "addressLine1": "2451Rue des Cuirassiers"333 * },334 * "tag": "SHIPPING"335 * },336 * {337 * "address": {338 * "formatted": "2451Rue des Cuirassiers\n9502 Grosshöchstetten\nSwitzerland",339 * "city": "Grosshöchstetten",340 * "subdivision": "CH-VD",341 * "country": "CH",342 * "postalCode": "9502",343 * "addressLine1": "2451Rue des Cuirassiers"344 * },345 * "tag": "BILLING"346 * },347 * {348 * "address": {349 * "formatted": "Israel",350 * "country": "IL"351 * },352 * "tag": "UNTAGGED"353 * }354 * ],355 * "labelKeys": [356 * "contacts.customers"357 * ],358 * "extendedFields": {359 * "contacts.displayByLastName": "Rousseau Celine",360 * "emailSubscriptions.deliverabilityStatus": "BOUNCED",361 * "ecom.lastPurchaseDate": "2021-03-29T21:00:35.835Z",362 * "members.membershipStatus": "APPROVED",363 * "ecom.numOfPurchases": 2,364 * "emailSubscriptions.subscriptionStatus": "NOT_SET",365 * "ecom.totalSpentAmount": 27.5,366 * "members.mobile": false,367 * "contacts.displayByFirstName": "Celine Rousseau",368 * "ecom.totalSpentCurrency": "ILS"369 * }370 * },371 * "lastActivity": {372 * "activityDate": "2021-03-29T20:58:47.548Z",373 * "activityType": "MEMBER_STATUS_CHANGED"374 * },375 * "primaryInfo": {376 * "email": "celine.rousseau@example.com",377 * "phone": "0177-7912572"378 * },379 * "source": {380 * "appId": "1380b703-ce81-ff05-f115-39571d94dfcd",381 * "sourceType": "WIX_STORES"382 * }383 * }384 * ]385 */