How to write a script in inbound email action (create event)

Ankitha2
Tera Contributor

How can we write a script in inbound email action in servicenow so that we can send the payload through email and get that payload as event in servicenow

1 ACCEPTED SOLUTION

Tony Chatfield1
Kilo Patron

Hi, I would not expect creating an event from inbound action to be any different to creating any other record type IE Incident. Exactly what you do will depend on the content and format of your email, if possible you should try to send your data as name: value pairs and I would recommend plain text (unless until you have a solution working).

If you cannot configure your email to deliver name: value pairs, then you can still parse your message body and extract data using basic javascript string functions.

There are some good examples of Inbound actions in an OOB PDI which are worth reviewing, as is the documentation.

https://docs.servicenow.com/bundle/rome-servicenow-platform/page/administer/notification/concept/c_InboundEmailActions.html

https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/administer/notification/reference/r_SetFieldValsFromTheEmailBody.html

 

 

View solution in original post

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, I would not expect creating an event from inbound action to be any different to creating any other record type IE Incident. Exactly what you do will depend on the content and format of your email, if possible you should try to send your data as name: value pairs and I would recommend plain text (unless until you have a solution working).

If you cannot configure your email to deliver name: value pairs, then you can still parse your message body and extract data using basic javascript string functions.

There are some good examples of Inbound actions in an OOB PDI which are worth reviewing, as is the documentation.

https://docs.servicenow.com/bundle/rome-servicenow-platform/page/administer/notification/concept/c_InboundEmailActions.html

https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/administer/notification/reference/r_SetFieldValsFromTheEmailBody.html