创建一个必需所有人批准的审批流Create an approval flow that requires everyone to approve

本演练介绍如何创建一个审批工作流,该工作流必需所有人(所有分配的审批者)都同意才能使验证得到批准,但任何审批者都可以拒绝整个申请。This walkthrough shows you how to create an approval workflow that requires everyone (all assigned approvers) to agree for a vacation request to be approved, but any approver can reject the entire request.

在需要个人的管理者和管理者的管理者都同意休假申请才能使其获得批准的组织中,此类型的审批工作流非常有用。This type of approval workflow is useful in an organization that requires a person's manager and the manager's manager, to both agree to a vacation request for it to be approved. 但是,任一管理者均可拒绝该申请,无需其他人的意见。However, either manager can decline the request without the other person's input.

备注

虽然本演练重点介绍的是休假审批方案,但是你也可以将这种审批流程用于任何需要多个审批者批准请求的情况。While this walkthrough highlights a vacation approval scenario, you can use this type of approval flow in any situation where multiple approvers are required to approve a request.

先决条件Prerequisites

  • Microsoft Flow、Microsoft Office 365 Outlook 和 Microsoft Office 365 用户的访问权限。Access to Microsoft Flow, Microsoft Office 365 Outlook, and Microsoft Office 365 Users.

  • SharePoint 列表A SharePoint list.

    本演练假设已创建了用于申请休假的 SharePoint 列表。This walkthrough assumes you've created a SharePoint list that's used to request vacations. 有关详细介绍 SharePoint 列表可能呈现的状态的详细示例,请参阅并行审批演练。See the parallel approvals walkthrough for an in-depth example that details what your SharePoint list might look like.

  • 熟悉创建流的基础知识。Familiarity with the basics of creating flows.

    可以查看如何添加操作、触发器条件You can review how to add actions, triggers, and conditions. 以下步骤假设用户了解如何执行这些操作。The following steps assume that you know how to perform these actions.

备注

虽然我们在本演练中使用 SharePoint 和 Office 365 Outlook,但你也可以使用其他服务,例如 Zendesk、Salesforce、Gmail 或 Microsoft Flow 支持的超过 200 款服务中的任意一款。While we use SharePoint and Office 365 Outlook in this walkthrough, you can use other services such as Zendesk, Salesforce, Gmail, or any of the more than 200 services that Microsoft Flow supports.

创建流Create the flow

备注

如果之前未创建与 SharePoint 或 Office 365 的连接,请在收到登录提示时按照说明进行操作。If you haven't created a connection to SharePoint or Office 365 previously, follow the instructions when you're prompted to sign in.

本演练使用令牌。This walkthrough uses tokens. 若要显示令牌列表,请点击或单击任意输入控制,然后在打开的“动态内容”列表中搜索该令牌。To display the list of tokens, tap or click any input control, and then search for the token in the Dynamic content list that opens.

登录到 Microsoft Flow 中,然后执行以下步骤来创建流。Sign into Microsoft Flow, and then perform the following steps to create your flow.

  1. 在屏幕右上角选择“我的流” > “从头开始创建”。Select My flows > Create from blank, in the top right of the screen.

  2. 添加 SharePoint - 当创建或修改项时触发器。Add the SharePoint - When an item is created or modified trigger.

  3. 为承载休假申请列表的 SharePoint 站点输入站点地址,然后选择该列表的“列表名称”。Enter the Site Address for the SharePoint site that hosts your vacation request list, and then select the list List Name.

  4. 添加“Office 365 用户 - 获取管理者 V2”操作,选择“用户 (UPN)”框,然后向其添加“由电子邮件创建”令牌。Add the Office 365 Users - Get manager V2 action, select the User (UPN) box, and then add the Created By Email token to it.

    由电子邮件创建令牌位于“动态内容”列表的“当创建或修改项时”类别之下。The Created By Email token is located under the When an item is created or modified category of the Dynamic content list. 此令牌为在 SharePoint 中创建项目的人员动态地提供访问有关管理者的数据的权限。This token dynamically provides access to data about the manager for the person who created the item in SharePoint.

  5. 添加另一个“Office 365 用户 - 获取管理者 V2”操作,然后将“邮件”令牌添加到“用户(UPN)”框。Add another Office 365 Users - Get manager V2 action, and then add the Mail token to the User (UPN) box.

    “邮件”令牌位于“动态内容”列表的“获取管理者 V2 2”类别之下。The Mail token is located under the Get manager V2 2 category of the Dynamic content list. 该令牌为管理者的管理者动态地提供对电子邮件地址的访问权限。This token dynamically provides access to the email address for the manager's manager.

    还可以将“获取管理者 V2 2”卡重命名为有意义的名称,例如“跳过平级管理者”。You can also rename the Get manager V2 2 card to something meaningful like "Skip level manager".

  6. 添加启动审批操作,然后从“审批者类型”列表中选择“已分配列表中的所有人”。Add the Start an approval action, and then select Everyone from the assigned list from the Approval type list.

    重要

    如果有任何审批者拒绝,则该审批申请对所有审批者来说都视为已拒绝。If any approver rejects, the approval request is considered rejected for all approvers.

  7. 使用下表作为完成“启动审批”卡的指南。Use the following table as a guide to complete the Start an approval card.

    字段Field 说明Description
    审批类型Approval type 使用“已分配列表中的任何人”指示任意一个审批者都可以批准或拒绝该申请。Use Anyone from the assigned list to indicate that any one of the approvers can approve or reject the request.

    使用 “已分配列表中的任何人” 指示申请仅在所有人都同意时才获得批准,只要有一人拒绝,便拒绝该申请。Use Everyone from the assigned list to indicate that a request is only approved if everyone agrees, and the request is denied if a single person rejects it.

    标题Title 审批申请的标题。The title of the approval request.
    分配到Assigned to 审批者的电子邮件地址。The email addresses of the approvers.
    详细信息Details 要发送给“分配到”字段中列出的审批者的任何其他信息。Any additional information that you want sent to the approvers listed in the Assigned to field.
    项链接Item link 审批项的 URL。A URL to the approval item. 在此示例中,这是指向 SharePoint 中的项的链接。In this example, this is a link to the item in SharePoint.
    项链接说明Item link description 项链接的文字说明。A text description for the Item link.

    提示

    启动审批操作提供多个令牌,包括响应响应摘要The Start an approval action provides several tokens, including Response and Response summary. 在流中使用这些流来为审批申请流的运行提供丰富的结果报告。Use these tokens in your flow to provide rich reporting of the results from a run of an approval request flow.

    “启动审批”卡是发送给审批者的审批申请的模板。The Start an approval card is a template for the approval request that's sent to approvers. 以对组织有用的方式配置它。Configure it in a way that's useful for your organization. 下面是一个示例。Here's an example.

    启动审批

  8. 添加 Office 365 Outlook - 发送电子邮件操作,然后将其配置为发送包含申请结果的电子邮件。Add the Office 365 Outlook - Send an email action, and then configure it to send an email with the results of the request.

    以下示例展示了“发送电子邮件”卡可能呈现的外观。Here's an example of what the Send an email card might look like.

    发送电子邮件

备注

启动审批操作后的任何操作都基于在“启动审批”卡上的“审批类型”中的所选内容来运行。Any action that follows the Start an approval action runs based on your selection in the Approval type list on the Start an approval card. 下表列出了基于所选内容的行为。The following table lists the behavior based on your selection.

审批类型Approval type 行为Behavior
已分配列表中的任何人Anyone from the assigned list 启动审批操作后的任何操作都在任何一个审批者决定之后运行。Actions that follow the Start an approval action run after any one of the approvers decides.
已分配列表中的所有人Everyone from the assigned list 启动审批操作后的操作在一个审批者拒绝或所有人批准申请后运行。Actions that follow the Start an approval action run after an approver declines or everyone approves the request.

在屏幕顶部,在“流名称”框中输入流名称,然后选择“创建流”来保存它。At the top of the screen, enter a name for your flow in the Flow name box, and then select Create flow to save it.

祝贺你,流已完成!Congratulations, your flow is complete! 如果按照步骤操作,流将如下图所示。If you followed along, your flow resembles this image.

总体流图像

现在,每当 SharePoint 列表添加项或项更改时,流都会触发,并向“启动审批”卡的“分配到”框中列出的所有审批者发送审批申请。Now, whenever an item is added to your SharePoint list, or if an item changes, your flow triggers and sends approval requests to all approvers whom are listed in the Assigned to box of the Start an approval card. 流通过 Microsoft Flow 移动应用和通过电子邮件发送审批申请。Your flow sends approval requests via the Microsoft Flow mobile app and via email. 在 SharePoint 中创建该项的人将收到总结了结果的电子邮件,明确指示已批准还是已拒绝该申请。The person who creates the item in SharePoint gets an email that summarizes the results, clearly indicating if the request was approved or rejected.

下面是发送给每个审批者的审批申请的示例。Here's an example of the approval request that's sent to each approver.

审批申请

以下示例展示在流运行后响应和响应摘要可能呈现的外观。Here's an example of what a response and a response summary may look like after your flow runs.

响应令牌

了解有关审批的详细信息Learn more about approvals