# Workflows: Define Variable Operator Replace action escaping issue

**URL:** <https://developer.sailpoint.com/discuss/t/workflows-define-variable-operator-replace-action-escaping-issue/69070>\
**Category:** Bugs\
**Tags:** workflows, identity-security-cloud\
**Created:** [June 26, 2024, 1:49pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable-operator-replace-action-escaping-issue/69070 "2024-06-26T13:49:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmilunich](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gmilunich/32/8431_2.png) [@gmilunich](https://developer.sailpoint.com/discuss/u/gmilunich)\
**Post date:** [June 26, 2024, 1:49pm UTC](https://developer.sailpoint.com/discuss/t/workflows-define-variable-operator-replace-action-escaping-issue/69070/1 "2024-06-26T13:49:56Z")

</div>

# What problem are you observing?

When working on a workaround [for another issue](https://developer.sailpoint.com/discuss/t/forms-and-workflows-text-area-field-with-multiple-lines-breaks-httprequest-processing-n-issue/69049/1) it was determined that we needed to use the Define Variable to replace the “\n” in the original variable with “\\n” in order for the system to parse it correctly. A new Define Variable step was added and the variable named. Then in the editor a new Operator for replace was added, and the values set:

 ![Screenshot 2024-06-25 at 1.47.30 PM](https://global.discourse-cdn.com/sailpoint/original/2X/4/4fbdcd1aa7e00d80aaa159afcd05c913e2b81c3f.png)

Once Apply was pressed, you can see the resulting escaped values in the right pane:

 ![Screenshot 2024-06-25 at 1.47.35 PM](https://global.discourse-cdn.com/sailpoint/original/2X/d/d4a9c21fe2eb87ba4e12244a140cca7ba6a9e960.png)

The remaining configuration was set up like the linked topic above.

When the variable is passed in, it has a value of:

```auto
line 1 \n line 2 \n line 3

```

When the replace processes it, it matches the pattern correctly, but the value stored in the resulting variable is as follows:

```auto
line 1 \\\\n line 2 \\\\n line 3

```

So the replace seems to be escaping the values when it stores the data into JSON, then matching correctly by unescaping the Pattern, but when it does the replace, it does NOT un-escape the Replacement value.

As a workaround to get this to work as desired above, both the Pattern and Replacement need to be set to “\n”

# What is the correct behavior?

The resulting variable should have the value the user entered for the replacement, not the escaped value.

# What product feature is this related to?

ISC Workflows, Define Variable Operator

# What are the steps to reproduce the issue?

See Above

# Do you have any other information about your environment that may help?
