Again Illegal charater in renaming file name

So I changed the folders to static folders as I don’t have access to your path.
In the move file a “” was missing and with the code you provided you will overwrite the PDF-Files generated as there is more then one. Also I’m not sure if you only download PDF-Files so I added a search pattern for the directory.getfiles.

So maybe something with the regular expression is not working as expected.
Please check the attached workflow.

test.xaml (19.7 KB)

Hi @FrankSchikora
How about when I do dynamic folder, won’t it work?

It should work - that’s what I meant about maybe the regex not working as expected because the basic concept of the workflow is working fine.
So I would suggest “hardcoding” your expected values to your variables and check if it works - if it does then something is wrong with how you assign your paths.

1 Like

When I do regex I got the output as expected but it was not working well when I tried to put. When doing hardcore it was working but extracting from third party it’s not working, why?

I’ve had this issue previously and it was due to stray new lines. For any variables you’re pulling from a thrid party, try sanitising the string using the below (assuming it only contains letters and numbers):

string.replaceAll("[^a-zA-Z0-9]+", "")

1 Like


Yes, i got the content of your config file. I was bit occupied with work. Just have some free time now. I’ll update you soon.

I’m not able to see few activities after getting current date month and year. May be this is due to the reason file is getting corrupted. Could you please share a snapshot for the same or explain a bit.


I went through your code and did few changes. I’m attaching the required files here. Please update your folders path as mentioned in xml file and run it. I tested this on my machine and it’s working. Let me know if this works for you or not.

FilePath.xml (157 Bytes)
test.xaml (14.4 KB)

One quick doubt, is there any condition in your usecase to move only pdf files. If yes, i need to add one more condition in code else for all types of files, this code works fine.

1 Like

Thank you


If it works for you, please close this thread and mark it as solution. It helps others too.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.