Error accessing a path from the config file

Does anyone know why the following might happen?

I am using a Move File activity to move a file to a path in a shared folder.

But it gives me this error

The strange thing is that if I write the path directly in the activity, it works correctly, but if I call it from the config, that’s when it crashes.

I already made sure that they are the same characters.

In fact, I have 2 workflows that use the same ‘Move File’ activity.

In the first workflow, the activity works correctly if I call the value directly from the config, but in the second workflow, it doesn’t.

To verify, I put the value that should go in the second workflow into the first one, and it works.

Have you checked that both workflows are same? You can try copying the same workflow to the 2nd one and changing the parameter.

Sometimes, even a space can cause such issue.

Or may be when you are calling that value in 2nd workflow, its value is getting changed in between 2 workflows which is leading to this issue.

Try printing the file path or run the process in Debug mode and verify the values that are going in and out of the workflow.

Hi @alexis.mendoza.rpa

This usually happens because the path coming from the config has hidden characters (extra spaces, line breaks, or quotes), even if it looks the same.

Things to check:

  • Use Trim on the config value before passing it to Move File
  • Check for trailing spaces or invisible characters (especially if it’s from Excel)
  • Make sure the config value is read as String and not Object
  • If it’s a UNC path, verify it starts exactly with “\”

That’s why hardcoding the path works, but reading it from config sometimes fails.

@alexis.mendoza.rpa

  1. When error occurs check the locals panel and see the variables have correct values
  2. better check the values from the activity proeprties in locals panel that will show exact values used

cheers

@alexis.mendoza.rpa

I’m sure you would have checked if the key is already present in the config or not and it would be available.

Now only one probability lefts that is in To property everything you passed being passed as string.

Open the To property by clicking here

the value should look like this

Not like this

@alexis.mendoza.rpa

Debug your automation and print log message before that move file activity and pass that file path variable in log message and see what you are getting,
compare it what you are getting and what it needs to be send.

And more over in config file make sure you are keeping with out any spaces at starting or ending if you are not sure about that then use trim at your variable.

Use log message activity to print and check the path printed is you want , as you it is working fine in 1st workflow check if variable still contains exact same path in second workflow.

Check the file extension, if manually path with extension is working then add extension in config file as well, If not remove extension from config file.