Flow designer - Variable is not passed properly to "Send Email" action

AEterni
Mega Guru

Hello Team,

 

  • An email is sent to our instance
  • I need to intercept the email
  • I need to parse the email
  • I need to build a specific URL from the parsed email
  • I need to send out a second email containing the link I build

I have created a flow that does all of that, but for some reasons the variable containing the URL I build in the flow is not passed properly to the "Send Email" action.

 

This is the flow.

AEterni_0-1730310592466.png

 

This is the variable I use to build the URL

AEterni_1-1730310614072.png

 

This is an example of a successfully executed flow where you can see that the URL is built properly.

AEterni_2-1730310646257.png

However, when the email is sent out, the link looks like this:

https://xxx.service-now.com/sp?id=sc_cat_item&sys_id=27352add1b2c2850676e97de1d4bcbc1&sysparm_catego...{

 

The part after "sysparm_variables={" is missing.

 

Do you have any idea why?

 

Thank you.

 

1 REPLY 1

AEterni
Mega Guru

I figured it out.

The issue arises because the URL I am embedding contains special characters, specifically { and }. These characters can be misinterpreted in various contexts, such as HTML, JSON, and URLs. In this case, it appears that ServiceNow Flow Designer is treating the characters inside sysparm_variables={...} as an unclosed or invalid expression, leading to parts of the link being removed or misinterpreted.

I replaced them with Encoded Characters:

  • { becomes %7B

  • } becomes %7D

  • " becomes %22

  • : becomes %3A