Flow Designer issue - if data pill string has quotes it bombs out the entire step

Shane J
Tera Guru

I am attempting to make a REST call via a custom Action in Flow Designer.  I have two fields I am trying to pass in my Request Content that can potentially have quotation marks (or other potential 'bad' characters).

 

Is there something I can do other than throwing a bunch of .replace on them to try to account for troublesome characters?

I'm already doing this before my REST step to try to account for this, but I'm sure our users will come up with some unknown way to break this.

 

 

 

//For Description:  Replaces carriage breaks and quotation marks  
var desc = inputs.multiline;
  var descNoLines = desc.replace(/(\r\n|\n|\r)/gm,"\\n").replace(/["']/g, "QUOTE");
  outputs.nolines = descNoLines;
  
//For Short Description:  Replaces quotation marks  
  var shortd = inputs.dirtyline;
  var descNoJunk = shortd.replace(/(\r\n|\n|\r)/gm,"\\n").replace(/["']/g, "QUOTE");
  outputs.cleanline = descNoJunk;

 

 

 Then use them here:

Screenshot 2023-04-28 132427.png

0 REPLIES 0