### Install Flow Approvals solution via PowerShell Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/setup?source=recommendations Use these commands to identify the target environment and install the Flow Approvals application using the Power Platform CLI. ```powershell $envs = (pac admin list --json | ConvertFrom-Json) | Where-Object { $_.DisplayName -eq "Your Environment Name" } pac application install --environment $envs[0].EnvironmentId --application-name "msdyn_FlowApprovals" ``` -------------------------------- ### GET /api/data/v9.2/cat_businessapprovalpublishedworkflows Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/content Retrieves a list of all published business approval templates. ```APIDOC ## GET /api/data/v9.2/cat_businessapprovalpublishedworkflows ### Description Lists all the published business approval templates by reading the Business Approval Published Workflows table. ### Method GET ### Endpoint /api/data/v9.2/cat_businessapprovalpublishedworkflows ``` -------------------------------- ### POST /api/data/v9.2/cat_businessapprovalworkflowqueues Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/content Creates a new record in the business approval workflow queue to start an approval process. ```APIDOC ## POST /api/data/v9.2/cat_businessapprovalworkflowqueues ### Description Creates a record in businessapprovalworkflowqueues to initiate a business approval workflow instance. ### Method POST ### Endpoint /api/data/v9.2/cat_businessapprovalworkflowqueues ### Request Body - **cat_runtimedata** (string) - Required - JSON serialized string containing runtime parameter values. - **cat_processid** (string) - Required - The unique identifier of the workflow process. ### Request Example { "cat_runtimedata": "[{\"id\":\"9a664958-c656-ee11-be6f-0022482a97de\",\"value\":\"True\"},{\"id\":\"7ddc1057-c656-ee11-be6f-0022482a91f4\",\"value\":\"123\"}]", "cat_processid": "57b2ee16-ea51-ee11-be6f-0022482a97de" } ``` -------------------------------- ### Get Approval Data Fields Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/content?source=recommendations Fetches the dynamic schema definitions for a selected workflow, enabling the retrieval of required data fields for starting an approval process. ```APIDOC ## GET /api/data/v9.2/cat_GetDynamicParameters(ProcessID={processID}) ### Description This operation helps in fetching the list of dynamic schemas applicable for the selected workflow. Under the hood, it calls a Custom API (`GetDynamicParameters`) which returns the schema definition based on the workflow ID provided/selected. ### Method GET ### Endpoint /api/data/v9.2/cat_GetDynamicParameters(ProcessID={processID}) ### Parameters #### Path Parameters - **processID** (Guid) - Required - The unique identifier of the process for which to retrieve data fields. ### Request Example None ### Response #### Success Response (200) - **value** (object) - An object containing the schema definition for the specified workflow. #### Response Example { "@odata.context": "...", "value": { "WorkflowName": "Example Workflow", "Fields": [ { "DisplayName": "Requester Name", "InternalName": "requesterName", "Type": "Text" }, { "DisplayName": "Approval Amount", "InternalName": "approvalAmount", "Type": "Number" } ] } } ``` -------------------------------- ### Start Business Approval Process in Power Automate Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/trigger-approvals This snippet shows how to initiate a business approval process within a Power Automate cloud flow using the Approvals Kit connector. Ensure you have created a connection to the Approvals Kit and selected the desired Workflow Process. ```Power Automate Start business approval process Sign in to create a connection. Select the Workflow Process you want to start. Enter the email address that relates to the person who is requesting this approval. Enter values for application data (variables) required by the workflow. Enter the name of the flow where the title is Untitled , and rename it to summarize your cloud flow. Select Save. ``` -------------------------------- ### GET /api/data/v9.2/cat_GetDynamicParameters(ProcessID={processID}) Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/content Fetches the dynamic schema definition for a specific workflow process. ```APIDOC ## GET /api/data/v9.2/cat_GetDynamicParameters(ProcessID={processID}) ### Description Fetches the list of dynamic schemas applicable for the selected workflow by calling the GetDynamicParameters custom API. ### Method GET ### Endpoint /api/data/v9.2/cat_GetDynamicParameters(ProcessID={processID}) ### Parameters #### Path Parameters - **processID** (string) - Required - The unique identifier of the workflow process. ``` -------------------------------- ### Workflow Instance JSON Payload Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/content?source=recommendations Example of the JSON structure used to update runtime data and process ID during the creation of a workflow instance. ```json "cat_runtimedata": "[{\"id\":\"9a664958-c656-ee11-be6f-0022482a97de\",\"value\":\"True\"},{\"id\":\"7ddc1057-c656-ee11-be6f-0022482a91f4\",\"value\":\"123\"},{\"id\":\"49dc1057-c656-ee11-be6f-0022482a91f4\",\"value\":\"\"},{\"id\":\"9b664958-c656-ee11-be6f-0022482a97de\",\"value\":\"10/11/2023 8:49:51 AM\"},{\"id\":\"7cdc1057-c656-ee11-be6f-0022482a91f4\",\"value\":\"Another title\"}]", "cat_processid": "57b2ee16-ea51-ee11-be6f-0022482a97de" ``` -------------------------------- ### Get Published Workflows Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/content?source=recommendations Retrieves a list of all currently active and published business approval workflows from Dataverse. ```APIDOC ## GET /api/data/v9.2/cat_businessapprovalpublishedworkflows ### Description This operation helps in listing all the published business approval templates by calling the native API and reading the table **Business Approval Published Workflows**. ### Method GET ### Endpoint /api/data/v9.2/cat_businessapprovalpublishedworkflows ### Parameters #### Query Parameters None ### Request Example None ### Response #### Success Response (200) - **value** (array) - An array of published workflow objects. #### Response Example { "@odata.context": "...", "value": [ { "@odata.etag": "...", "cat_businessapprovalpublishedworkflowid": "...", "cat_name": "Example Workflow Name" } ] } ``` -------------------------------- ### Create Workflow Instance Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/content?source=recommendations Initiates a business approval process by creating a record in the `businessapprovalworkflowqueues` table with the provided runtime data and process ID. ```APIDOC ## POST /api/data/v9.2/cat_businessapprovalworkflowqueues ### Description This operation helps in creating a record in `businessapprovalworkflowqueues` by making a POST operation to the native API. This operation performs the final POST call to create the record. ### Method POST ### Endpoint /api/data/v9.2/cat_businessapprovalworkflowqueues ### Parameters #### Request Body - **cat_runtimedata** (string) - Required - JSON serialized string containing the runtime data for the approval process. - **cat_processid** (string) - Required - The unique identifier of the process (Workflow ID). ### Request Example ```json { "cat_runtimedata": "[{\"id\":\"9a664958-c656-ee11-be6f-0022482a97de\",\"value\":\"True\"},{\"id\":\"7ddc1057-c656-ee11-be6f-0022482a91f4\",\"value\":\"123\"},{\"id\":\"49dc1057-c656-ee11-be6f-0022482a91f4\",\"value\":\"\"},{\"id\":\"9b664958-c656-ee11-be6f-0022482a97de\",\"value\":\"10/11/2023 8:49:51 AM\"},{\"id\":\"7cdc1057-c656-ee11-be6f-0022482a91f4\",\"value\":\"Another title\"}]", "cat_processid": "57b2ee16-ea51-ee11-be6f-0022482a97de" } ``` ### Response #### Success Response (200) - **businessapprovalworkflowqueueid** (string) - The unique identifier of the created workflow queue record. #### Response Example { "@odata.etag": "...", "businessapprovalworkflowqueueid": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ``` -------------------------------- ### Create Workflow Instance Record Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/content?source=recommendations Endpoint for creating a record in the businessapprovalworkflowqueues table via a POST operation. ```http /api/data/v9.2/cat_businessapprovalworkflowqueues ``` -------------------------------- ### App Registration for Custom Connector Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/setup Steps to register an application in Microsoft Entra admin center to interact with Dataverse tables and Custom APIs. This is required for updating the Approvals kit custom connector. ```powershell # No code provided, only procedural steps. ``` -------------------------------- ### Retrieve Published Workflows via API Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/content?source=recommendations Endpoint used to list all published business approval templates from the Business Approval Published Workflows table. ```http /api/data/v9.2/cat_businessapprovalpublishedworkflows ``` -------------------------------- ### Fetch Dynamic Approval Data Fields Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/content?source=recommendations Endpoint to retrieve dynamic schema definitions for a specific workflow ID using the GetDynamicParameters custom API. ```http /api/data/v9.2/cat_GetDynamicParameters(ProcessID={processID}) ``` -------------------------------- ### Configure Dataverse Trigger for Approvals Source: https://learn.microsoft.com/en-us/power-automate/guidance/business-approvals-templates/trigger-approvals This configuration sets up a Power Automate cloud flow to trigger when a row is added, modified, or deleted in a Microsoft Dataverse table. It specifies the trigger type, table, scope, and run-as context for the approval process. ```Power Automate Choose your flow's trigger seardch field, type dataverse , and then select When a row is added, modified or deleted. Select Create. In the Change Type field, select Added. In the Table Name , select a table you want to trigger approvals with. In the Scope field, select Organization. Expand Show advanced options. In the Run as field, seleect Row owner. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.