Question

Staidlogic
IN
Last activity: 16 Jun 2025 6:36 EDT
How to fetch data using phone number with or without country code in Pega?
Hello,
I'm working on a Pega application where I fetch customer details based on the phone number entered in the UI. The data is retrieved using an activity with Obj-Open, matching the phone number stored in the database.
However, users might enter the phone number:
- With country code (e.g., +91XXXXXXXX or 91XXXXXXX )
- Without country code (e.g., 876XXXXXX)
I want the system to retrieve the record regardless of the format entered.
Current Configuration:
- Using Obj-Open in an activity (Get Data) on a data class.
- Matching is done using .PhoneNumber from the Primary page.
- Phone numbers in the database are currently stored with country code.
What I Need:
- A way to normalize the phone number (strip country code or non-numeric characters).
- Possibly store and compare with a consistent what phone number format from call.
- Suggestions on best practices for matching phone numbers reliably (regardless of format).
Has anyone implemented something similar? What's the recommended approach?
Any help or shared pattern would be appreciated.
Thanks!