按钮流简介Introducing button flows

什么是按钮流?What are button flows?

我们都希望只需点击几下按钮就可以运行许多重复性任务。There are many repetitive tasks that we all wish we could run with just a tap of a button. 例如,你可能需要快速地向团队发送电子邮件,提醒他们参加每天的团队同步会议,也可能需要开始新的 Visual Studio Online 代码库生成,因为你已获得通知,知道今天不会再计划其他签入。For example, you may need to quickly email your team to remind them to join the daily team sync, or you may want to start a new Visual Studio Online build of your code base after you've been notified that there are no more checkins planned for the day. 使用按钮流,只需在移动设备上点击一下按钮,即可完成此类任务以及许多其他的任务。Button flows allow you to accomplish these and many other tasks simply by tapping a button on your mobile device.

注意:可以从移动设备或 Flow 门户创建按钮流。Note You can create button flows either from your mobile device or from the Flow portal.
概略图Overview image

为什么创建按钮?Why create buttons?

创建按钮即可随时随地通过移动设备轻松地运行重复性任务。Create buttons so that you can easily run repetitive tasks from anyplace, at anytime via your mobile device. 执行按钮可以节省时间,而且,由于任务是自动执行的,发生错误的可能性比手动执行要低。Executing buttons saves you time and, since the tasks they perform are automated, there will be less errors than if you manually did them.

创建按钮Create a button

先决条件Prerequisites

  • 访问 Flow。Access to Flow. 管理员可以为用户提供访问权限。Your administrator can provide you with access.
  • 一个有权使用连接器创建按钮的帐户。An account with permissions to use the connectors to create your button. 例如,若要创建可以访问 Dropbox 的按钮,需要一个 Dropbox 帐户。For example, you will need a Dropbox account in order to create a button that accesses Dropbox.

从门户From the portal

本演练需创建一个按钮,以便启动 Visual Studio Online (VSO) 生成并在生成启动以后向用户发送相关通知。In this walk-through, let's create a button that starts a Visual Studio Online (VSO) build and sends notifications to let you know when the build starts:

  1. 选择“显示”下拉列表,然后选择“按钮”类别。Select the Showing drop down list and choose the Button category. 这样会筛选出一系列只能用在按钮流中的模板。This filters the list of templates to only those that can be used in button flows.
    概略图Overview image
  2. 从模板列表中选择“在 VSO 中触发新的生成”模板。Select the Trigger a new build in VSO template from the list of templates.
    概略图Overview image
  3. 在“在 VSO 中触发新的生成”页中选择“使用此模板”按钮。Select the Use this template button on the Trigger a new build in VSO page.
    概略图Overview image
  4. 如果用户没有登录,系统此时会提示用户登录:If you aren't signed in, you'll be prompted to do so at this point:
    概略图
  5. 用户登录到 Flow 以后,系统会提示其登录到所选模板中使用的连接器。After you've signed into Flow, you'll be prompted to sign into the connectors used in the template you've selected. 此示例已在上面的步骤 2 中选择了“在 VSO 中触发新的生成”模板,因此如果尚未登录,则需登录到 VSO(以及所使用的任何其他连接器):In this example, in step 2 above we selected the Trigger a new build in VSO template, so we have to sign into VSO (and any other connectors you are working with), if you're not already signed in:
    概略图Overview image
  6. 如果同意授权 Flow 访问 VSO 帐户,请选择“接受”按钮。Select the Accept button if you agree to authorize Flow to access your VSO account.
    概略图 Overview image
    注意:需采取类似方式向每个连接器授权。Note You'll need to authorize each connector similarly. 准备执行下一步操作时,设计器应如下所示。The designer should appear like this when you are ready to move on to the next step. 选择“继续”按钮继续:Select the Continue button to move on:
    概略图Overview image
  7. 现在可以配置要启动的生成的属性了:You are now ready to configure the properties for the build you wish to start:
    概略图
  8. 在“对新生成排队”卡中,选择或输入“帐户名称”、“项目名称”、“生成定义 ID”、“源分支”以及“参数”(可选):Select or enter the Account name, Project name, Build definition Id, Source branch and optionally, Parameters, in the Queue a new build card:
    概略图Overview image
  9. 接下来,请在“发送推送通知”卡中配置推送通知的属性。Next, configure the properties of the push notification on the Send a push notification card. 默认情况下,此推送通知配置为发送显示生成状态的网页的 HTML 链接:By default, this push notification is configured to send an HTML link to a Web page that displays the status of the build:
    概略图Overview image
  10. 选择“创建流”按钮保存按钮流:概略图Select the Create flow button to save your button flow: Overview image
  11. 过一会儿就会看到以下成功消息:You should see this success message within a few moments:
    概略图

恭喜,你已创建按钮流!Congratulations, you've created a button flow! 现在,你可以在 Flow 应用中通过“按钮”选项卡随时随地运行此按钮流。You can now run this button flow anytime, anyplace, from the Buttons tab in the Flow app. 一按“按钮”即可运行!Simply press the "button" and it will run! Microsoft Flow 移动应用适用于 AndroidiOSWindows PhoneThe Microsoft Flow mobile app is available for Android, iOS, or Windows Phone.

从移动设备From your mobile device

注意:本演练显示的是 Android 设备的屏幕,但 iOS 设备上的屏幕和体验是类似的。Note: While this walk-through displays screens from an Android device, the screens and experience on an iOS device are similar.

在 Flow 应用中:In the Flow app:

  1. 选择“浏览”选项卡,滚动到“按钮”类别。Select the Browse tab and scroll to the Button category.
    概略图Overview image
  2. 选择“全部查看”链接。Select the See all link. 此时会显示所有准备就绪的按钮模板。This displays all ready-to-go button templates.
    概略图Overview image
  3. 选择“发送电子邮件,提醒团队参加会议”模板Select the Send an email to remind your team to join a meeting template
    概略图Overview image
  4. 选择页面底部的“使用此模板”链接。Select the USE THIS TEMPLATE link, at the bottom of the page.
    概略图Overview image
  5. 用户需登录到此模板使用的所有服务:You'll need to sign into all services that this template uses:
    概略图
  6. 登录到所有服务以后,选择“下一步”链接。Select the Next link after you've signed in to all services.
    概略图Overview image
  7. 选择“创建”链接。Select the Create link. 在这里还可以查看流并进行相关操作,例如进行电子邮件个性化所需的任何更改。Here you can also review the flow and make any changes you require to personalize the email, for example.
    概略图Overview image
  8. 几分钟后就会创建好按钮流。After a few moments, the button flow is created. 选择“查看我的流”:Select SEE MY FLOW:
    概略图Overview image
  9. 在“我的流”选项卡上查看所有流View all your flows on the My flows tab
    概略图Overview image

恭喜,你已创建按钮流!Congratulations, you've created a button flow! 现在,你可以在 Flow 应用中通过“按钮”选项卡随时随地运行此按钮流。You can now run this button flow anytime, anyplace, from the Buttons tab in the Flow app. 一按“按钮”即可运行!Simply press the "button" and it will run! Flow 应用目前可在 Android 和 iOS 移动设备上使用。The Flow app is currently available on Android and iOS mobile devices.

概略图

触发按钮流Trigger a button flow

创建按钮流后即可马上运行。Now that you've created a button flow, it's time to run it. 由于只能从 Flow 应用运行按钮流,因此请确保在 Android 或 iOS 移动设备上安装 Flow。Since you can only run button flows from the Flow app, be sure you've installed Flow on your Android or iOS mobile device.

  1. 现在请启动 Flow 应用,点击位于页面底部的“按钮”选项卡,然后点击代表要触发的按钮流的“按钮”:Now, launch the flow app, tap the Buttons tab that's located at the bottom of the page, and tap the button that represents the button flow you wish to trigger:
    概略图Overview image
  2. 查看流运行时的进度:See the progress while the flow runs:
    概略图
  3. 最后页面会更新,表明按钮流已完成:Finally, the page updates, indicating that the button flow has completed:
    概略图

这就是运行流的整个过程。That's all there is to running a flow.

此时会收到推送通知,表明电子邮件已发送。You should now receive the push notification, indicating that the email has been sent.

监视按钮流运行Monitor your button flow runs

可以在 Flow 应用的“活动”选项卡中监视按钮流:You can monitor button flows from the Activity tab of the flow app:
概略图Overview image

注意:点击任意活动即可深入查看运行结果,了解运行的情况。Note: Tap any activity to drill into the results of the run to learn about the run.

概略图

管理按钮流Manage button flows

用户对按钮流具有完全控制权限,可以随时随地启用/禁用、编辑或删除按钮。You have full control of your button flows so you can enable/disable, edit or delete a button anytime, anyplace. 通过移动应用或 Flow 门户选择“我的流”即可开始管理流。From the mobile app or from the flow portal, select My flows to get started managing your flows.

在 Flow 应用的“我的流”选项卡上执行以下操作:On the My flows tab of the Flow app:

  1. 选择要管理的流:Select the flow you wish to manage:
    概略图
  2. 可以点击其中任何一个选项,具体取决于要完成的任务:You can tap any of these options, based on what you'd like to accomplish:
    概略图
  3. 点击“删除流”将流删除。Tap Delete flow to delete a flow.

注意:删除流时,将会删除所有运行历史记录:Note All run history is deleted when you delete a flow:
概略图Overview image

  1. 编辑完按钮流以后,点击“更新”保存所做的更改:Tap Update after you are done editing a button flow, to save your changes:
    概略图Overview image
  2. 点击“运行历史记录”,查看特定按钮流的所有运行的结果:Tap Run history to see the results of all runs of a particular button flow:
    概略图Overview image
  3. 如果禁用某个流,该流将不再出现在“按钮”选项卡上:If you disable a flow, it will no longer be available on the Buttons tab:
    概略图Overview image

后续步骤Next steps