Flow designer - Variable is not passed properly to "Send Email" action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 10:52 AM
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.
This is the variable I use to build the URL
This is an example of a successfully executed flow where you can see that the URL is built properly.
However, when the email is sent out, the link looks like this:
The part after "sysparm_variables={" is missing.
Do you have any idea why?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 02:03 PM
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