cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Apostrophe in the content causing nintex workflow to fail. Web request , rest api

Jump to solution

Need help, i am using web request action and using REST API call to create an item in nintex workflow. 

{
'__metadata' : { 'type' : '{WorkflowVariable:txtListItemEntityTypeFullName}' },
'Title' : '{ItemProperty:Title}',

}

if Title value contains apostrophe  in the content For Ex: Bob's Car,workflow is failing. Please help me to handle ' in the workflow

Labels: (1)
Tags (1)
Reply
6 Replies
Workflow Hero

Re: Apostrophe in the content causing nintex workflow to fail. Web request , rest api

Jump to solution

Hi Vijay A R‌,

Try to enclose the title propery in the {TextStart} and {TextEnd} text tags:

{TextStart}{ItemProperty:Title}{TextEnd}

This is sometimes also need in for example fn-trim when the string to trim could contain comma's.

0 Kudos
Reply
Workflow Hero

Re: Apostrophe in the content causing nintex workflow to fail. Web request , rest api

Jump to solution

{TextStart} and {TextEnd} , what it does? is it Nintex default variable?

0 Kudos
Reply
Workflow Hero

Re: Apostrophe in the content causing nintex workflow to fail. Web request , rest api

Jump to solution

I did this in build string action {TextStart}{ItemProperty:Title}{TextEnd}, still my workflow is encoutering in error

0 Kudos
Reply
Workflow Hero

Re: Apostrophe in the content causing nintex workflow to fail. Web request , rest api

Jump to solution

And if you try one of these:

  1. in stead of using the tags in a build string, use it directly in the rest message. You need to use where you experience the actual string problem. The Build String with these tags will return the same string......These tags are scanned for by the workflow engine, and interpret all characters in between as 1 string, no matter if there are quotes or commas (e.g. if you have a string with a comma, the fn-trim function will see the comma as a separator between 2 function parameters) in there.
  2. replace the single quotes with double quotes: 'Title': "{ItemProperty:Title}"
  3. fn-replace({ItemProperty:Title},',\')
  4. use Xml-Encode (or Xml-Decode; I always mix those 2 up)
0 Kudos
Reply
Workflow Hero

Re: Apostrophe in the content causing nintex workflow to fail. Web request , rest api

Jump to solution

XmlEncode works for me . Thank you

But any idea how to use nintex inline function ex: XmlEncode in javascript?

0 Kudos
Reply
Workflow Hero

Re: Apostrophe in the content causing nintex workflow to fail. Web request , rest api

Jump to solution

If you need to encode something in JavaScript then you should use JavaScript functionality for this, which can be found with a simple Google search. If you put your string in double quotes then JS should be able to properly handle apostrophe characters, e.g. var myString = "This is a 'test' text.". URLs can be encoded using encodeURI().

0 Kudos
Reply