Create a Request Item using data passed in Inbound Email in ServiceNow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 05:56 PM
Hi There,
I have a requirement to create a request item when the below data is passed to ServiceNow's mail ID using Inbound Email Action. Below is the fixed format ServiceNow will be receiving, want to understand how to parse the data in :
Region: AMER
Country: Canada (Reference field)
Company: Test Canada Inc. (Reference field)
City: Montreal (Reference field)
Department: Information Technology (IT) (Reference field)
SF ID: 123000
Employee ID: 123000
Cost Center: 000123
Job Title:
Personal Title:
First Name: Test Onboarding
Legal Name:
Last Name: ServiceNow
Date of Joining: 2024-06-15
Line Manager: Tejas Test
Line Manager Email: tejas.test@test.com
Ticket URL:
Ticket ID: SR-114283
Thanks,
Tejas

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 06:22 PM
Hi @Community Alums ,
1)In your inbound action, use below format to read Name : Value pair
email.body.name
ex: email.body.region //this will get you AMER value i.e AMER
2)Use cart api to create a request as bwlow
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
var item = cart.addItem('sys_id of the catalog item');
cart.setVariable(item, 'variable name', value) // ex: cart.setVariable(item, 'region', email.body.region)
var rc = cart.placeOrder();
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 07:02 PM
Hi @Hemanth M1 ,
I tried below script and it's creating Incident instead Request.
Script:
Thanks,
Tejas

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 07:26 PM
Hi @Community Alums ,
1)can you try this in the background script by passing static values and try to print rc which should give you the sysID of the request number
2)and try to print parsing email content in the inbound.
3) Check if any other inbound actions are executing during this
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 08:01 PM
Hi @Hemanth M1 ,
The below background script triggering request, please let me know how to use that in inbound email.