Is there a wildcard character to use for the rest api/table api?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2024 03:18 PM - edited ‎04-09-2024 03:20 PM
Hi all,
I'm using the rest api to search on contacts by phone number, but the phone number format can be widely varied. Because of this, sometimes the query fails if it is not an exact match. I found some documentation regarding wildcards for the global search but nothing for the api. I've tried the same characters for the api with no luck, the * or % characters. Is this something that is supported with the api or is it not available?
Ideally I'd be able to do something like *1*123*123*1234 to match all forms of different phone number formats such as 1 (123) 123 1234, 1 (123)-123-1234, 1 123-123-1234, +11231231234
I saw some suggestions to make another field and do a format on it and then run my query against this field... I dont think that would work for me. I would preferably like to not create a custom field just to search on this one phone number field, since the alternative means creating custom fields for every phone number field I want to query on...
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2024 08:01 PM
Hi @James Rac,
You can use an encoded query to fetch all the records that match a condition.
e.g.
Note that I am querying on the [sys_user] table where the user name contains Alex.
This will return 3 records like below:
You should be able to do the same for your contact query with slight adjustments.
Hope it helps, cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2024 09:26 PM
Hi @James Rac
Below post could be helpful :
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2024 09:54 PM - edited ‎04-09-2024 10:03 PM
hi @James Chun & @Amit Verma,
I read this post already in search of my answer. The problem with these answers in this post would only apply if I did partial searches on the phone number variable. For things like the operating system looking for any windows/linux/etc, this makes sense, but for phone numbers, if I know the full number but I just want to account for multiple us/international formats, doing a like with a partial query doesn't in my opinion.
Thanks for the quick responses however, it is appreciated. I'm open for any other ideas. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2024 10:23 PM
Hi @James Rac
You can construct a regex pattern that matches various phone number formats and then store in your field. For example, the regex pattern \b1(?:[.-]?[0-9]){10}\b would match phone numbers like 1 (123) 123 1234, 1-(123)-123-1234, etc.
Regards,
Amit