In my example it basically gets the information from the file that was recently created. However, let’s wait for @badita’s answer or someone else, because in my example it will only work for files that were recently created, however it wouldn’t work if the user changes/deletes the previous files or something like this, it won’t get the information you need. I tried to get this information from NotifyFilters as well, but it was not possible
Thanks for your response, but the solution is risky, i hope @badita could help us a little more with a proper solution to only get what was actually triggered.
I’d be interested to find out how to do this as well. I can’t seem to get any information back from GetEventInfo after a FileChangeTrigger event. I have downloaded @acaciomelo example and this appears to be safe. Would you recommend using this approach?
@acaciomelo I try to copy two files into monitor folder at the same time, but it sames doesn’t work by your example. It pop up the same info twice time. Do you have any good idea about this condition?
You can get the name of the file which caused the trigger by using
Get Event Info Activity and settings its property TypeArgument to System.IO.File.SystemEventArgs.
Your return variable should have a FullPath method which gives the name of the file which caused the trigger. Main.xaml (6.9 KB)
@Yoshi_Akiyama’s xaml solution works fine however when doing it with the UiPath.Core.Activities.FileChangeTriggerV2, it doesn’t seem to trigger the Event Handler.
Anyone have any idea’s why? or any other solution for getting the name of the file that changed?
Thanks @Yoshi_Akiyama works like a charm. But I just can use the v1 and not the v2. Somehow the v1 is not in my list. You have an idea how to use the v1 without copy pasting it from your example?
Hi @kwoxer
I’m looking into this right now. Mean time please downgrade UiPath.Sytem.Activities to 19.8.0
to have File Change Trigger V1 to show up in the activities panel.
If your not familiar with Package manager please refer to below doc.
I find how you can retrieve the file information using v2. Just access the FileChangeInfo variable. you dont have it on your list but it will exist on the FileChangeTriggerV2 context.
it has the same properties that FileSystemEventsArgs has. Hope this helps.
Cheers
Hello everyone, it seems like the documentation team is taking some time to create the documentation, so going to provide a quick update here.
Basically, V1 had issues, thus we created V2.
V2 has a scope inside, so instead of putting File Change Trigger inside Monitor events activity, please use it stand alone.
I am pushing the documentation team to update.