Workflow REST Message Activity Escaping Characters

Jamie Imms
Kilo Expert

Hello,

I have a REST Message that when called from a Workflow, escapes special characters.

 

When I run a test directly from the HTTP Method (by clicking the 'Test' UI Action and manually setting the variables), it works fine and creates this record:

find_real_file.png

 

But when I run the exact same method from a Workflow via a REST activity (both by using the 'Test Inputs' UI action and manually setting the variables, or by running the workflow and letting the variables get pulled from record fields), it gets inputted like this:

find_real_file.png

The REST Message has these headers:

find_real_file.png

Can anyone point me in the right direction? I'm not too well versed on this.

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Jamie,

 

So is the request being sent correctly and received properly in 3rd party.

Which http method is used here?

Also how are you setting the variables is it through variable substitution and in workflow you are using REST message activity or run script to trigger the rest endpoint.

 

Regards

Ankur

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

Hi bawiskar,

 

I am using a POST to insert a record.

 

When I set the variables manually through the HTTP Method directly and do a Test Run, it works fine.

 

I am using a Workflow activity (custom REST web service, selecting the same HTTP Method, pictured below) with variable substitution. If I let it get the variables from the current Workflow record, or if I manually set them and test via the Test Input UI Action, it won't handle the character correctly.

find_real_file.png

find_real_file.png

Hi Jamie,

 

If the worklfow activity doesn't allow you to escape characters, then why not use Run Script and escape that character.

 

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Jamie Imms
Kilo Expert

It ended up being a pretty silly mistake on my part - just needed to set the 'Additional attribute' to 'Do not escape text' on the workflow REST activity:

 

find_real_file.png