powerappspower-automatepowerapps-canvaspowerapps-collection

How to trigger a Power automate flow at a specific time (not schedule) using Canvas app?


So I am trying to build this application using powerapps. In the application, the user can set a specific time at which an event should occur (example sending an email or make a social media post at the specified time).

So my approach for building this app: I have created a flow in power automate that is used to make a social media post. This flow can be triggered from the Canvass app. The canvass app will have a date and time column in a form where the user can specify the time at which the Post should be made (i;e the event should occur via flow)

The problem is: How do I trigger this flow at the time specified by the user

Now I've looked into scheduled cloud flow but I think that's a different use case. It is used to automate things at regular interval ex: send mails daily at 5PM, but that's not what I want. I want the user to specify the time at which the flow should be triggered.

Can you all please point me towards the right approach ?


Solution

  • In this case you can have a flow that is triggered by Power Apps, and one of the parameters of the flow would be the time that you want the action to be executed - which you can use in the 'Delay until' action from Flow, like in the example below:

    enter image description here

    From your Canvas app side, you can pass the time in UTC format as required by the 'Delay until' action using the Text function:

    Delayedaction.Run(
        Text(
            DatePicker1.SelectedDate + Time(ddHour.Selected.Value, ddMinute.Selected.Value, 0),
            DateTimeFormat.UTC))
    

    Your flow will likely have more arguments (the information for the social media post), and you can retrieve them using additional arguments in your flow.