How to fetch value of a paragraph in inbound action

Community Alums
Not applicable

Hi Team,


Can someone tell me how to read the value of Description field from the inbound email which is inside a paragraph tag.

 

Description:</td>
<td valign="top" align="left" class="updates-diff-content" style="border-collapse:collapse; border-spacing:0px; color:#172b4d; padding:0px; vertical-align:top; text-align:left; padding-bottom:5px">
<p style="margin-top:0; margin-bottom:10px; margin:1em 0; margin:0; margin-top:0">
Description field for incident "Test incident 2024-10-16_002"</p>
<p style="margin-top:0; margin-bottom:10px; margin:1em 0; margin:0">&nbsp;</p>

 

 

After we do  gs.info(email.body.description);

We get NULL or blank value. I have noticed this is comin because of <p> tag.

Can someone tell how to resolve this?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

it's a table so you will have to use string manipulation

But this will only work when the email coming is consistent, if the email comes with some other string combination your script won't work

check these links

Get the values from HTML table from an email in a Inblund Action 

Inbound Email Action: - Extract data from an html table

Inbound email action to read data from HTML email

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

it's a table so you will have to use string manipulation

But this will only work when the email coming is consistent, if the email comes with some other string combination your script won't work

check these links

Get the values from HTML table from an email in a Inblund Action 

Inbound Email Action: - Extract data from an html table

Inbound email action to read data from HTML email

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Community Alums 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader