I set a variable called "current_file" to the following:
"\\GENERAL\Vol1\Groups\UHC\Common\Rerates\2016-2017\PDFs\Test_Rerate2016.pdf"
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"
Thanks!
Replace function not taking variable
Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
- Support_Rick Offline
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
- Contact:
Re: Replace function not taking variable
ramonr,
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.
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
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696