Create request via inbound action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 04:34 AM
Hi All,
I have one requirement on to create request via inbound action and all details in the email body must be set in variables of the catalog item. Could please help me on this to get the proper solution.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 04:57 AM
Hi @suru2,
Checkout this
https://www.servicenow.com/community/developer-forum/fill-out-the-variables-of-an-item-using-inbound...
Please hit helpful and accept this as a solution if it solved your problem.
Thankyou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 05:01 AM
Hi @suru2, you can achieve that by creating an intermediate table and a transform map, which can then be used for processing the data the script of the inbound email action.
First, grab the data in the email body, parse them, trim them, and clean them as much as you can. I recommend playing with regex heavily, and not rely on a single write-only query. Take your time to fine-tune them. Then, create records in the intermediate table.
The following function will trigger the default transform map:
function transform(importSetGR) {
var transformer = new GlideImportSetTransformer();
transformer.transformAllMaps(importSetGR);
return transformer.getImportSetRun();
}