How to create a request through email

Hrithikah
Tera Contributor

Hi All,

 

We’ve received a requirement to create a request directly from an email. We attempted to configure this using Flow designer and the “Submit a Catalog” action by triggering a catalog; however, this approach doesn’t meet our needs.

 

Specifically, we need to create a request without triggering any catalog items, while still generating the associated RITM and SC Task records.

 

Could anyone please advise on how we can achieve this?

Any guidance would be greatly appreciated.

 

Regards,

Hrithika Paida

 

 

1 ACCEPTED SOLUTION

so you want to create Request and RITM and Sc task and you want to link them?

 

why not submit the catalog item (which you are already doing)?

what's the business requirement?

 

this way the workflow/flow will also trigger.

 

you can create sc task and and RITM and associate them with request 

 

add 2 more create task actions in the flow 1 for sc_req_item preferably after the request action

and 1 for the sc_task after the RITM

ChaitanyaILCR_2-1767962071761.png

 

 

 

ChaitanyaILCR_1-1767962047798.png

 

note this will not trigger the flow/workflow the proffered way would be submit catalog item action

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

View solution in original post

18 REPLIES 18

Hi,

I missed adding request item. We are triggering the flow through inbound email and It worked for me by this method.

Hi @Hrithikah ,

I see that this approach has worked for you.

Can you close this thread by accepting the post as a solution ?

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

Hi @Chaitanya ILCR ,

 

Thanks for the solution provided.

 

I just have one last question. How can we get the user details present in the email into the requested for (reference) field of the created request record.

 

I tried using the below script in flow it did not work. 

var emailBody = fd_data.trigger.inbound_email.body_text;
var requestedForMatch = emailBody.match(/email \s*(.*)/i);
if (requestedForMatch) {
    fd_data.requested_for_name = requestedForMatch[1].trim();
}

Hi @Hrithikah ,

you can use the User Record data pill for user information

ChaitanyaILCR_0-1768321645246.png

 

you can mark multiple responses as answers if this works please mark this as answer too

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

Najmuddin Mohd
Mega Sage

Hello @Hrithikah ,

You can use ServiceNow OOB Cart API () to create a Request, which will be associated to RITM and SCTasks.

https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/...


for (i = 0; i < 2; i++) { 
var cart = new sn_sc.CartJS();
var item =
{
'sysparm_id': '0d08837237153000158bbfc8bcbe5d02',
'sysparm_quantity': '1',
'variables':{
'carrier': 'at_and_t_mobility',
'data_plan': '500MB',
'duration': 'eighteen_months',
'color': 'slate',
'storage': 'sixtyfour' 
}};
var cartDetails = cart.addToCart(item);
gs.info(JSON.stringify(cartDetails));
}


Here, you give the Catalog Item sys_id, variables and it triggers the Catalog.


If the above information helps you , Kindly mark it as Helpful and Accept the solution.

Regards,
Najmuddin