Trying to create Action Workflow to add actions and email Prospect Manager

Options

I'm attempting to create a new Power Automate flow that will pull all prospects that are currently in “Assessment Status” and then look at their actions. If 0 Actions, then it will Create a New Action with a type of “WorkFlow”, so that I know it came from my Power Automate Work flow. The way I would like it to work, is if they have an Open action with Type = “WorkFlow”, then my process would email the Prospect manager telling them they need to check their Work Center. If all of the “WorkFlow” actions are “closed” then I would need to create a new one (we have an order to follow - Email1, Email2, PhoneCall1, PhoneCall2, EmailANDPhoneCall, and finally HandWrittenNote.

My problem right now is what is the best way to look at a Constituent's Actions and try to determine which Action I need to add next from the list above (Email1, Email2, PhoneCall1, PhoneCall2, EmailANDPhoneCall, and finally HandWrittenNote). I'm not sure there is any method to how to Constituent Actions are returned. I thought of Adding them to an Array and maybe sorting it? But again, I cant seem to see a way to sort a variable array.

I'd appreciate any ideas on the best way to handle this. Thank you!!

Categories