Need assistance with Approval | Collecting responses and storing

Cody Nester 0 Reputation points
2024-05-30T16:11:33.6766667+00:00

Hello,

I am trying to find a solution for my office to (submit request) - (get approval/denial) - (store request and response data).

I was attempting to use power automate, but I continue to run into issues getting the flow to function completely.

I have tried two approaches.

Approach 1 (Form Triggered)

Within Power Automate:

  1. Completed form triggers,
  2. Form details are pulled
  3. Initialize Variable - DenyCount
  4. Post Response in Team - Posts Form details
  5. Post Adaptive Card in Team - JSON derived question with "approve / deny" buttons
       {
       "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
         "type": "AdaptiveCard",
         "version": "1.3",
         "body": [
       {
       "type": "TextBlock",
       "text": "Do you approve the emergency move request EMITR# @{triggerOutputs()?['body/resourceData/responseId']}?",
       "wrap": true
       }
       ],
       "actions": [
           {
             "type": "Action.Submit",
             "title": "Approve",
             "data":  {
              "ResponseID": "@{triggerOutputs()?['body/resourceData/responseId']}",
                "Vote": "Approve"
         }
       },
       {
       "type": "Action.Submit",
       "title": "Deny",
       "data": {
         "ResponseID": "@{triggerOutputs()?['body/resourceData/responseId']}",
          "Vote": "Deny"
          }
       }
       ]
       }
    
  6. Initialize Variable - ApproveCount
  7. Parse JSON - (responseID and "vote" data of "approve/deny" was not pulling)
       {
           "type": "object",
           "properties": {
               "responseTime": {
                   "type": "string"
               },
               "responder": {
                   "type": "object",
                   "properties": {
                       "objectId": {
                           "type": "string"
                       },
                       "tenantId": {
                           "type": "string"
                       },
                       "email": {
                           "type": "string"
                       },
                       "userPrincipalName": {
                           "type": "string"
                       },
                       "displayName": {
                           "type": "string"
                       }
                   }
               },
               "submitActionId": {
                   "type": "string"
               },
               "messageId": {
                   "type": "string"
               },
               "messageLink": {
                   "type": "string"
               },
               "data": {
                   "type": "object",
                   "properties": {
                       "ResponseID": {
                           "type": "string"
                       },
                       "Vote": {
                           "type": "string"
                       }
                   },
                   "required": [
                       "ResponseID",
                       "Vote"
                   ]
               }
           },
           "required": [
               "responseTime",
               "responder",
               "submitActionId",
               "messageId",
               "messageLink",
               "data"
           ]
       }
    
  8. Compose - (again, trying to force recognition of either approve or deny vote being placed) - Appears this is not working, but I am unable to see details as raw input/outputs are not available. I only have an option to "download input/outputs" but nothing happens when attempting this.
  9. Approve Condition - (IF equals(body('Parse_JSON')?['data']['Vote'],'Approve') is equal to Approve)
    1. Yes - Increment Variable ApproveCount by 1.
    2. No
      1. Deny Condition - if equals(body('Parse_JSON')?['data']['Vote'],'Deny') is equal to Deny
        1. Yes - increment Variable DenyCount by 1
  10. Condition - (for testing purposes) If ApproveCount is greater than or equal to 1
    1. yes - Send Email to Form Submitter with approval

In this processes, the flow will run successfully, but it is not actually successful. AT both condition actions it is reporting No or False, even when the vote button Approve is selected.

Approach 2 - Also Form Triggered

  1. Form is submitted
  2. Approval action with Form details (The problem here, I need 60% approval for a request to move forward. It doesn't appear there is a way to do this with an Approval action, nor have I figured out a way to capture and export the responses automatically. The Approval Action via power automate also sends a notification via Teams as well as Email, I only want responses to go via Teams.

What I really need.

A way to notify and request a specific group via team to vote. Capture responses in an excel sheet, the same sheet that captures the Submitted Form. Once 60% approval has been reached, send an email to the requester and post a message in the team channel that the request was approved.

It if isn't evident from my post, I am a novice with these automation tools, I would greatly appreciate any tips or direction.

Thank you!

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,439 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,008 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.