Similar to what I've done here, I need to disable Private DNS when Work Profile apps are being used because the secure tunnel doesn't work when the DNS is enabled.
Is there a way for MacroDroid to detect when a Work Profile app is active?
I am not 100% sure, but if my understanding is correct, ... then
Unfortunately, I don't think it's possible
because the profile is just data to be referred from a certain App, like when you start to use such Enterprise Outlook.
So, the profile can not be a condition where the state is active or not.