Background Process with Monitor Events from UIAutomation.Activities result in removing the background status.
That means. When I start a new Background process. All is fine. But I would like to use the Monitor Events activity now. So I need to add the package UIAutomation.Activities. But when I do this the Background Status of the project is gone.
But I really need that process as background process. For me it does not make any sense. Why is the background status gone when I simly add the Monitor Events? For me that’s an activity that is especially for background tasks.
The concept of background automation is different. Background automation only allows to automate tasks that do not require any interfaces. These automations run in the background without showing any screens while allowing the user to continue with his work without any disturbance… So you cannot interact with any interfaces just like you do with normal automations. If you want to perform automation that require application interaction through interfaces, then you cannot use the background automation option. Additionally, you can run multiple background automation solutions at the same time where as, the other automations can only run one process at a time.
For example
Background automation + background automation = possible
Background automation + normal automation that require UI interaction = not possible
So if you are using background automation, you will have different properties in the project.json file. If you add the Ui Automation activities, then that feature will be removed automatically…
You said you want to listen to a folder here… So I’m guessing you are trying to monitor a particular change in this folder, like new files, new folders etc. so that can trigger the execution… Am I correct?
or is it something different that you are trying to do?
Edit: if you are monitoring for particulat change like new file creations etc you can always use
Directory.GetFiles(FolderPath)
And capture the new files or folders created or modified. If checking for properties of files, you can do that too different other activities like getting the last modified date without the use of monitor activities…
Let’s say you want to trigger if a new file is created. You can use the above method and check whether new files are there. Then continue with the flow, if not stop the execution… like wise…
Indeed. I have a folder where my Flow of Power Automate is putting new files.
So using the Monitor Events is the easiest way. And it runs properly. I really would like to keep on using it. Instead of doing a workaround now with the “GetFiles” thing. I know I could also run a task every minute and watch for changes in the folder. But smarter would be the Monitor event. =/
And if I extract that activity from the package? Could that work and how is that possible? Is there some tutorial?
Yeah… I know… it is not the best way to handle it…
Let’s try to figure out a better way over the time to fix it… For now, I think it will be ok.
I am also looking for a better solution over this as I also have the same requirement. So if I come across anything, I will definitely reach out to you…