Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Inbound Email Action – parsing HR emails (hidden characters, cut values, location match)

Not applicable

Use case
Our HR system (SuccessFactors) sends onboarding and termination emails. An Inbound Email Action reads the email, creates a RITM, and a flow creates regional tasks based on location.

Problems
1. Labels like "Employment Type" were not found.
2. Values with a colon were cut. Example: H:\Accounting became H.
3. Location was empty or matched a retired site.
4. The flow did not start its regional branch.

Root causes
1. The emails contain hidden zero-width spaces and non-breaking spaces, so label matching failed.
2. The script split each line on every colon.
3. Site names in the email did not exactly match cmn_location names (accents, short names). The active flag on cmn_location was a custom field, so the normal active filter did not work.
4. The location variable was a Choice field, not a Reference to cmn_location, so the flow could not dot-walk to Region.

Fix
1. Clean the email body first: remove zero-width characters and replace non-breaking spaces with normal spaces.
2. Split each line on the first colon only.
3. Change the location variable to Reference, pointing to cmn_location.
4. Match location step by step, so it is never empty:
- exact name match on active sites
- alias list match
- closest active match by shared words
- log unmatched values for review
5. In the flow, branch on location.region.

Tips
- Build the alias list from old RITM history.
- Test with accented site names.
- Check which field means "active" on your cmn_location table.

Hope this helps. Happy to share more details if needed.

2 REPLIES 2

Hemanth M
Tera Sage

Hi, Can you publish this a quick developer blog with a sample data sets??

 

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025,2026

Ankur Bawiskar
Tera Patron

so what's your question?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader