Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
Expand all | Collapse all

Power Automate Send Approval to Group Members and Create List Item for each approval

  • 1.  Power Automate Send Approval to Group Members and Create List Item for each approval

    Gold Contributor
    Posted Apr 12, 2021 09:21 AM
      |   view attached
    Hello, I've followed Laura's blog post - https://wonderlaura.com/2020/01/27/power-automate-approval-to-office-365-group-members/ - to send approval to Azure AD Group members and then create a SP list item for each one. I've skipped the parts where she changes permissions as that's not a requirement for our scenario. I'm able to get the group members' email addresses as shown in "Get group members" step. When I run the Flow, the Start and Wait for approval action hangs for what seems indefinitely. In this one the Flow has been running for 8 minutes, but the approval email hasn't been sent to any group members. I've also tried creating an array variable and adding the email addresses as an array as shown in Attempt 2, but I'm having the same issue there.

    ------------------------------
    Beth Beck
    O365 Business Analyst
    Fort Myers FL
    ------------------------------


  • 2.  RE: Power Automate Send Approval to Group Members and Create List Item for each approval

    Posted Apr 13, 2021 04:17 AM
    Hi Beth,

    You seem to be applying the "Start and Wait for approval" as part of the "Apply to each approver" block. Get the list of approver emails as a variable like what you are doing however bring the approval step below that block so that you are not starting the approval step for every iteration but once after you have the list of approvers.

    Regards,
    Luke

    ------------------------------
    Luke Burgess
    SharePoint Administrator/Developer
    ------------------------------



  • 3.  RE: Power Automate Send Approval to Group Members and Create List Item for each approval

    Gold Contributor
    Posted Apr 15, 2021 08:24 AM
    Thank you for responding Luke! I moved the Start/Wait for Approval to a new block below and those emails are being sent. I am now having an issue with creating a list item in SharePoint for each response. This type of approval goes to roughly 30 people and we want to track each responder's name and outcome. However, some approvers may not respond in time as the group has regular meetings where they go over any policy questions. So I think what I need to do is extract non-responses versus those that do respond. I've tried different approaches, but Flow continues to fail at this Apply to Each action. Clearly I'm doing something wrong.

    The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Start_and_wait_for_an_approval')?['responses']' is of type 'Null'. The result must be a valid array.

    ------------------------------
    Beth Beck
    O365 Business Analyst
    Fort Myers FL
    ------------------------------



  • 4.  RE: Power Automate Send Approval to Group Members and Create List Item for each approval

    Posted Apr 15, 2021 09:32 AM
    Hi Beth,

    Try using the Responses items below rather than "Responses". Responses is a rollup of all replies where as you have it cycling through a for each loop. I use these to keep an audit on the approval tasks in lists and you simply iterate through each response and add it into a SharePoint list column

    Not sure that this is going to do what you need though. The list items won't be created until after everyone has completed the approval step. Ie you won't be able to see who hasn't responded.

    I haven't tried this but in theory... If you need to see who has responded you might need to look at spinning up child flows so instead of creating the approvals in this you create the approvals in another flow that is started from within for each in this one. Not sure how it would work however each approval task would then be separate and finish after each response. Call Child Flows - Power Automate | Microsoft Docs.

    Regards,
    Luke


    ------------------------------
    Luke Burgess
    SharePoint Administrator/Developer
    ------------------------------



  • 5.  RE: Power Automate Send Approval to Group Members and Create List Item for each approval

    Gold Contributor
    Posted Apr 19, 2021 10:24 AM
    Hi @Luke Burgess,
    Thank you so much for the feedback. Your suggestion to use the Response Items in screen shot makes sense. I'll try that. If that option doesn't work, I'll then try the parent/child flow solution. That may be a better approach. Appreciate your feedback!

    ~Beth​

    ------------------------------
    Beth Beck
    O365 Business Analyst
    Fort Myers FL
    ------------------------------