Microsoft Flow 和 Power BIMicrosoft Flow and Power BI

Microsoft Flow 是一款跨企业用户依赖的日益增多的应用程序和 SaaS 服务自动执行工作流的 SaaS。Microsoft Flow is a SaaS offering for automating workflows across the growing number of applications and SaaS services that business users rely on. 使用 Flow,可以通过集成常用应用和服务(包括 Power BI)来自动执行任务,从而获得通知、同步文件、收集数据等。With Flow you can automate tasks by integrating your favorite apps and services (including Power BI) to get notifications, synchronize files, collect data, and more. 借助工作流自动化,执行重复任务不再是难事。Repetitive tasks become easy with workflow automation.

立即开始使用 Flow。Get started using Flow now.

观看 Sirui 创建一个 Flow,该 Flow 在 Power BI 警报触发时向同事发送包含详细信息的电子邮件。Watch Sirui create a Flow that sends a detailed email to colleagues when a Power BI alert is triggered. 然后按照视频下面的分步说明来自己尝试一下。Then follow the step-by-step instructions below the video to try it out yourself.

创建由 Power BI 数据警报触发的流Create a flow that is triggered by a Power BI data alert

本教程介绍了如何创建两个不同的流:一个是通过模板创建,另一个是从头开始创建。This tutorial will show you how to create two different flows; one from a template and one from scratch. 若要继续学习本教程,请在 Power BI 中创建数据警报,然后注册 Microsoft Flow(此产品免费!)。To follow along, create a data alert in Power BI and sign up for Microsoft Flow (it's free!).

通过模板创建使用 Power BI 的流Create a flow that uses Power BI - from a template

在此任务中,我们将使用模板创建一个由 Power BI 数据警报(通知)触发的简单流。In this task we'll use a template to create a simple flow that is triggered by a Power BI data alert (notification).

  1. 登录到 Microsoft Flow (flow.microsoft.com)。Sign in to Microsoft Flow (flow.microsoft.com).
  2. 选择“我的流”。Select My flows.

  3. 选择“使用模板创建”。Select Create from template.

  4. 在搜索框中查找 Power BI 模板,然后选择“在 Power BI 数据警报触发时将消息发布到 Slack 通道”。Use the Search box to find Power BI templates and select Post a message to a Slack channel when a Power BI data alert is triggered.

  5. 选择“使用此模板”。Select Use this template.

  6. 如果系统出现提示,请选择“登录”,然后按提示操作,从而连接 Slack 和 Power BI。If prompted, connect to Slack and Power BI by selecting Sign in and then following the prompts. 绿色对勾表明你已登录。A green checkmark lets you know that you're signed in. 确认连接后,选择“继续”。After you confirm your conections, select Continue.

生成流Build the flow

此模板包含一个触发器(通知爱尔兰新获奥运会奖牌的 Power BI 数据警报)和一个操作(将消息发布到 Slack)。This template has one trigger (Power BI data alert for new Olympic medals for Ireland) and one action (post a message to Slack). 在你选择字段的同时,Flow 会显示可以包含的动态内容。As you select a field, Flow displays dynamic content that you can include. 在此示例中,我们将在消息正文中添加磁贴值和磁贴 URL。In this example we'll included the tile value and the tile URL in the message body.

  1. 在触发器下拉列表中,选择一个 Power BI 数据警报。From the trigger dropdown, select a Power BI data alert. 选择“爱尔兰新获奖牌”。Select New medal for Ireland. 若要了解如何创建警报,请参阅 Power BI 中的数据警报To learn how to create an alert, see Data alerts in Power BI.

  2. 若要向 Slack 发布信息,请输入通道名和消息文本(还可以选择 Flow 创建的默认消息)。To post to Slack, enter a channel name and message text (you can also select the default message that Flow creates). 请注意我们已在消息文本字段中添加的动态内容。Notice the dynamic content that we've included in the message text field.

    备注

    在通道名称开头添加“@”。Include "@" at the beginning of your channel name.</span></span> <span data-ttu-id="fbeb4-133">例如,如果 Slack 通道名为“channelA”,请在 Flow 中输入 “@channelA”。For example, if the Slack channel is named "channelA", in Flow enter "@channelA".

  3. 完成后,选择“创建流”或“保存流”。When you're done, select Create flow or Save flow. 此时,系统已创建并计算流。The flow is created and evaluated. Flow 会在有错误时提示你。Flow lets you know if it finds errors.
  4. 如果有错误,请选择“编辑流”修复错误。如果没有错误,请选择“完成”运行这一新流。If errors are found, select Edit flow to fix them, otherwise, select Done to run the new flow.

  5. 打开你的 Slack 帐户,查看消息。Open your Slack account to see the message.

从头开始创建使用 Power BI 的 FlowCreate a Flow that uses Power BI - from scratch (blank)

在此任务中,我们将从头开始创建一个由 Power BI 数据警报(通知)触发的简单流。In this task we'll create a simple flow from scratch that is triggered by a Power BI data alert (notification).

  1. 登录 Microsoft Flow。Sign in to Microsoft Flow.
  2. 依次选择“我的流” > “从头开始创建”。Select My flows > Create from blank.

  3. 使用搜索框查找 Power BI 触发器,然后选择“使用 Power BI 数据驱动的警报触发流”。Use the Search box to find a Power BI trigger and select Trigger a flow with a Power BI data driven aler.

生成流Build your flow

  1. 在下拉列表中,选择警报名称。From the dropdown, select the name of your alert. 若要了解如何创建警报,请参阅 Power BI 中的数据警报To learn how to create an alert, see Data alerts in Power BI.

  2. 依次选择“下一步” > “添加操作”。Select New step > Add an action.

  3. 搜索 Outlook,然后选择“创建事件”。Search for Outlook and select Create event.

  4. 填写事件字段。Fill in the event fields. 在你选择字段的同时,Flow 会显示可以包含的动态内容。As you select a field, Flow displays dynamic content that you can include.

  5. 完成后,选择“创建流”。Selet Create flow when done. 此时,Flow 会保存并计算流。Flow saves and evaluates the flow. 如果没有错误,请选择“完成”运行此流。If there are no errors, select Done to run this flow. 此时,系统会将这一新流添加到“我的流”页中。The new flow is added to your My flows page.

  6. 当 Power BI 数据警报触发流时,你会收到如下 Outlook 事件通知。When the flow is triggered by your Power BI data alert, you'll receive an Outlook event notification similar to this one.

后续步骤Next steps