Search by not formatted number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 12:04 PM
Hi! I am trying to find a contact record in servicenow by phone number using their REST Api. Sample request:
https://your_domain
/api/now/contact?sysparm_query=mobile_phoneLIKE512^mobile_phoneLIKE757^mobile_phoneLIKE6000
In the CRM record looks like this:
but
, there is no limitation on how it can be saved/formatted. It can be something like this (512) 757 6000
or this 512-757-6000
. I don't have limit on formatting of this field.https://your_domain
/api/now/contact?sysparm_query=mobile_phoneLIKE*512*757*6000 So, my question id: Is there some way to find "randomly" formatted phone number in sysparm_query? Wildcards? Filters? Filter functions?
- Labels:
-
Integrations
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 02:00 PM
Hi Rocio,
If the field is of type phone number it always sets to (XXX) XXX-XXXX format irrespective of how you enter and as long as it is 10 digit. If the user saves the record with '+' at the front then it saves with no formatting like +1XXXXXXXXXX. In your sysparm_query you can update the user input with (XXX) XXX-XXXX and +1XXXX and try to query the table with OR condition and that should return the results.