Replace function not taking variable

If you have a new question you’d like our support staff to post a response to, please visit our customer community, Data Security Insiders, to pose the question in our Discussion Boards. We have a thread “Ask Our Tech Experts” that our support team monitors on a regular basis, or you can start a new discussion where other GoAnywhere users and support staff can weigh in. Log in or create your new account at

If you need an immediate response, please create a support ticket or contact our support team by email at [email protected].
2 posts Page 1 of 1


Posts: 1
Joined: Wed Jul 27, 2016 11:57 am

Post by ramonr » Wed Jul 27, 2016 12:23 pm
I set a variable called "current_file" to the following:

I then tried to replace some of the text in the variable current_file as shown below:

${Replace(current_file, '\\GENERAL\Vol1\Groups\UHC\Common\Rerates\2016-2017\PDFs\', '')}

When I run this it gives me an error stating:
"An unexpected error occurred. Function 'Replace': Parameter '1' must be a string value. Function definition: 'Replace(text, regex, replacement) returns string' Original expression: Replace(current_file, '\\GENERAL\Vol1\Groups\UHC\Common\Rerates\2016-2017\PDFs\', ''). "

Why is it not allowing me to use a variable in parameter 1? The user guide says that I should be able to use "Any string, variable or function that returns a string value"



Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Mon Aug 01, 2016 6:01 pm

More than likely, you are performing this replace from within a For-Each loop and utilizing "Current_File" as the current item variable.

Change your task and replace "Current_File" with "String( Current_File )" then try it again.

Please let us know if this works for you.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1