简体   繁体   English

如何使用 Canvas 应用程序在特定时间(而非计划)触发 Power 自动化流程?

[英]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.所以我正在尝试使用 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.此流程可以从 Canvass 应用程序触发。 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.它用于定期自动执行操作,例如:每天下午 5 点发送邮件,但这不是我想要的。 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 ?你们能指点我正确的方法吗?

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:在这种情况下,您可以拥有一个由 Power Apps 触发的流,流的参数之一是您希望执行该操作的时间 - 您可以在 Flow 的“延迟直到”操作中使用该时间,如下例所示:

在此处输入图片说明

From your Canvas app side, you can pass the time in UTC format as required by the 'Delay until' action using the Text function:从您的 Canvas 应用程序端,您可以使用 Text 函数按照“延迟直到”操作的要求以 UTC 格式传递时间:

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.您的流程可能会有更多参数(社交媒体帖子的信息),您可以使用流程中的其他参数检索它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM