- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I turned on 'automatically create users for incoming emails from trusted domain'. Is it possible to pull phone numbers, if phone numbers are associated with the email information?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
This runs and created user when an email is sent from any user from trusted domain and user is not present in sys_user table.
It will not fetch any other information. (apart from name and email). For fetching any other information, you need integration with AD of your org.
More details in : https://www.servicenow.com/docs/bundle/zurich-platform-administration/page/administer/notification/t...
Please mark the answer correct/helpful accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @athavichith ,
In your inbound email action, use a script in the Script field That reads email.body_text (or email.body) and uses a regular expression to find the phone number. Example:
var phoneMatch = email.body_text.match(/Phone:\s*([\d\-\(\)\s]+)/i);
if (phoneMatch && phoneMatch[1]) {
var phone = phoneMatch[1].trim();
current.phone_number = phone; // phone_number is a field created
}
After extracting the phone number, link it to the user record (if the user is created or exists). You might query sys_user by email (using email.from) to get the user’s record and set their phone field, or set a custom field on the incident/request/etc....
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/