Inbound Email Action creates the Case but fails to populate fields from SAP-generated email template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
'm experiencing an issue with a ServiceNow Inbound Email Action and would appreciate any insights.
I have an Inbound Email Action configured with Action Type = Record Action, which creates a record in the Case table.
For emails sent from internal sources, everything works as expected:
- The Case is created successfully.
- The Inbound Email Action reads the email content correctly.
- All required fields are populated based on the values extracted from the email body.
However, when the email is sent from an external SAP system, the behavior is different:
- The Case is still created successfully, which indicates that the Inbound Email Action is being triggered.
- However, the values from the email body are not being extracted correctly, and several fields are left empty or populated incorrectly.
Although the information is clearly visible in the received email, the Inbound Email Action is unable to parse it correctly and populate the corresponding fields on the Case record.
My current assumption is that the issue may be related to the email format. Internal emails seem to be processed correctly, while the SAP-generated email is sent as an HTML-formatted email template.
Some questions I have are:
- Could this be related to the difference between email.body_text and email.body?
- Does ServiceNow handle SAP-generated HTML emails differently from standard emails?
- Could MIME structure, HTML tags, encoding, or multipart content prevent the expected values from being extracted?
- Has anyone successfully parsed information from SAP-generated HTML emails using an Inbound Email Action?
For troubleshooting, I have already confirmed that:
- The Inbound Email Action is triggered.
- The Case record is created.
- The issue only affects the extraction and mapping of data from the email content.
Any recommendations, best practices, or similar experiences would be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hey @MargaridaC
This could be due to differences in the email body format.
I would recommend logging and comparing email.body and email.body_text for both internal and SAP-generated emails.
SAP-generated HTML emails may contain nested tags, tables, special characters, or different line breaks that affect existing parsing logic.
Try normalizing the email content before extracting values. Also, avoid relying on fixed positions or line breaks; use field labels and regular expressions for reliable extraction.
First, identify whether the issue is with the email content or the parsing logic.
*************************************************************************************************************************************
If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb