RE: Power Automate trigger on record update problem
Hi Martin,
I am surprised that your record is updated several times in such a short time. Is this triggered by other workflows or plugins? Anyway, I think you can solve your issue with the following approach.
You can use the following optionSet field as a flag:
- Waiting to be Sent
- Sending attempt
- Sending successfully
You set the flag to "Sending attempt" using a synchronous workflow BEFORE the lead is updated and if the flag is equal to "Waiting to be sent".
Your Power Automate cloud flow will be executed after the synchronous workflow. Your flow will be triggered and send an email if the flag is equal to "Waiting to be sent". Once the email is sent, your flow will set the flag to "Sending successfully".
Note that you can configure your Power Automate Cloud flow trigger by choosing the fields that can trigger the flow:
With this approach, the email will only be sent once.
We can also improve this process by sending only one email per day by adding a second technical field of type date which will contain the date on which the last email was sent and another synchronous workflow.
The second workflow will set the flag to "Waiting to be sent" if the flag is equal to "Sending successfully" and the technical field of type date is not equal to today's date. Then the first workflow will automatically set the flag to "Sending attempt" and the power automate will also be triggered and send the email. For your Power Automate, you will need to set today's date in the technical field after the email is sent.
EDIT: It seems too complicated. There may be another solution.