Flow Submit Catalog Item Requests variables need escaping


Description

Flow Submit Catalog Item Requests variables need escaping if it contains double quotes

Steps to Reproduce

1. Create a subflow
2. Add a subflow input of type string
3. Add the "Submit Catalog Item Request" action to the flow and configure it to an existing catalog item
4. Populate Variables of catalog item. For a text variable use a string with a double quote.
5. Test the subflow, notice no errors creating request item
6. Now replace the text variable with the input variable created in step 2
7. Test the subflow. Provide the same value as earlier (text value with a double quote). Notice the flow errors.
8. Now replace each " with a \" in your input variable. retest the subflow. Notice no error.
9. Navigate to RITM. Notice value appears unescaped.
10. Now reset your variable to a hardcoded value, and put the input value on "special instructions". Test the subflow with the string containing a quote.
11. Notice the flow does not error. Navigate to the REQ and observe the string is not unescaped.

Workaround

When a flow/subflow uses "Submit Catalog Item Request" action and if an input variable has double quotes(") in it. Flow/Subflow errors out. 

Workaround/solution is to escape the double quotes before passing it to variables.

We can escape them using javascript replaceAll method either in an inline script or a script step in an action.

Script is : variableWithQuotes.replaceAll("\"","\\\"");

 


Related Problem: PRB1444915