- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2017 12:46 PM
I am using an inbound action to parse the body of the email. I have done this fine for strings and where the name of the name/value pair is one word. However, I am unable to figure out how to parse it when the name is separated by a space.
Two questions:
1) How to parse where name has spaces?
2) How to insert into a Date type field?
Email Example
<Body>
Pricing Effective: 04/11/2017
</Body>
Inbound Action Script
current.u_my_custom_date_field = email.body."Pricing Effective";
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2017 01:08 PM
Ignore the previous one.
The Date format should be same as system date format
var mydate = email.body_text.indexOf('Pricing Effective: ');
var gDate = new GlideDate();
gDate.setValue(mydate);
gs.info(gDate);
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2017 12:49 PM
Hi Jeffrey,
You can use
current.u_my_custom_date_field = email.body_text.indexOf('Pricing Effective: ');
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2017 12:58 PM
Thank you! Do you know if I have to do anything specific to make this a date. If the field was created as a "Date" type, do I need to transform the string value or will it automatically translate that for me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2017 01:04 PM
You will have to convert it to date. Try if below works.
var mydate = email.body_text.indexOf('Pricing Effective: ');
current.u_my_custom_date_field = new GlideDate(mydate);
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2017 01:08 PM
Ignore the previous one.
The Date format should be same as system date format
var mydate = email.body_text.indexOf('Pricing Effective: ');
var gDate = new GlideDate();
gDate.setValue(mydate);
gs.info(gDate);
Please mark this response as correct or helpful if it assisted you with your question.