Invoke code error Exception has been thrown by the target of an invocation

Hi @Justine

newFileName column contains value with linebreak and that’s also an illegal character.

image

image

image

image

you can replace the new break in the newFileName before passing it to argument

try below code to replace the line break

row(“newFileName”).ToString.Replace(vbLf,“”)

image

Also you can give a try with Rename File activity to achieve same result.

image

If you use this activity, then no need to replace the line break. activity itself will handle the line break

Thanks
John