Inbound Email Action Spacing Issues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2014 07:32 AM
Hi all,
I have an inbound email action to automatically created incident tickets. In this inbound action I have the body of the email being copied into the description field using this line:
current.description = email.body_text;
When Service Now is processing the email, it is adding an extra line return after each line.
For example, if an email has a list the looks like this:
Item 1
Item 2
Item 3
Service Now processes it as
Item 1
Item 2
Item 3
This makes my description field look extremely long. Is there any way to setup how this is brought in by the instance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2014 07:48 AM
The only way i could think of addressing this is to deplaciert all Double line breaks with a single one:
Something like:
var text = email.body_text.toString(); current.description = text.replace('\n\n', '\n');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2014 09:31 AM
eican's solution probably needs the global attribute:
text.replace(/\n\n/g,'\n');
Another way would be to perform a split on line breaks, and then delete any array element containing the empty string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2014 11:42 AM
That would definitely work but it probably wouldn't be as efficient
Though I find this a little strange since I work with inbound actions all the time and I never get issues with extra line feeds coming through.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2014 01:18 PM
I have seen it a couple of times in the activity field, but only for emails sent from an Outlook client