Connect an Adaptive Form with Microsoft® Power Automate

You can configure an Adaptive Form to run a Microsoft® Power Automate Cloud Flow on submission. The configured Adaptive Form sends captured data, attachments, and Document Of Record to Power Automate Cloud Flow for processing. It helps you build custom data capture experience while harnessing the power of Microsoft® Power Automate to build business logics around captured data and automate customer workflows. Here are a few examples of what you can do after integrating an Adaptive Form with Microsoft® Power Automate:

  • Use Adaptive Forms data in a Power Automate business processes
  • Use Power Automate to send captured data to more than 500 data sources or any publicly available API
  • Perform complex calculations on captured data
  • Save Adaptive Forms data to storage systems at a predefined schedule

Adaptive Forms editor provides the Invoke a Microsoft® Power Automate flow submit action to send adaptive forms data, attachments, and Document Of Record are sent to Power Automate Cloud Flow. To use the Submit action to send captured data to Microsoft® Power Automate, Connect your Forms as a Cloud Service instance with Microsoft® Power Automate

Prerequisites

The following are required to connect an Adaptive Form with Microsoft® Power Automate:

  • Microsoft® Power Automate Premium license.

  • Microsoft® Power Automate flow with the When an HTTP request is received trigger to accept Adaptive Form submit data.

  • A Experience Manager user with Forms Author and Forms Admin privileges.

  • Ensure the account used to connect to Power Automate is the owner of the Power Automate flow.

Connect your Forms as a Cloud Service instance with Microsoft® Power Automate

Perform the following actions to connect your Forms as a Cloud Service instance with Microsoft® Power Automate:

  1. Create a Microsoft® Azure Active Directory Application
  2. Create Microsoft® Power Automate Dataverse Cloud Configuration.
  3. Create Microsoft® Power Automate Flow Service Cloud Configuration
  4. Publish the Microsoft® Power Automate Dataverse Cloud Configuration.

Create Microsoft® Azure Active Directory Application

  1. Log in to Azure Portal.

  2. Select Azure Active Directory from the left navigation.

  3. On the Default directory page, select App registrations from the left panel.

  4. On the App registrations page, click New Registrations.

  5. Specify Name, Supported account types, and Redirect URI on the page. In the Redirect URI, specify the following and click Save.

    • https://[Forms as a Cloud Service Server]/libs/fd/powerautomate/content/dataverse/config.html
    • https://[Forms as a Cloud Service Server]/libs/fd/powerautomate/content/flowservice/config.html

    Register a Azure Active Directory Application

    NOTE

    You can also specify additional Redirect URIs, if necessary, from the Authentication page.
    For supported account types, select single tenant, multiple tenants, or personal Microsoft Account depending on your use case

  6. On the Authentication page, enable the following options, and click Save.

    • Access tokens (used for implicit flows)
    • ID tokens (used for implicit and hybrid flows)
  7. On the API permissions page, click Add a permission.

  8. Under Microsoft® APIs, select the Flow Service, and select the following permissions.

    • Flows.Manage.All
    • Flows.Read.All

    Click Add permissions to save the permissions.

  9. On the API permissions page, click Add a permission. Select APIs my organization uses and search DataVerse.

  10. Enable user_impersonation and Click Add permissions.

  11. (Optional) On the Certificates & secrets page, click New client secret. On the Add a Client Secret screen, provide a description and time period for the secret to expire, and click Add. A secret string is generated.

  12. Keep a note of your organization specific Dynamics environment URL.

Create Microsoft® Power Automate Dataverse Cloud Configuration

  1. On AEM Forms author instance, navigate to Tools hammer > General > Configuration Browser.

  2. On the Configuration Browser page, tap Create.

  3. In the Create Configuration dialog, specify a Title for the configuration, enable Cloud Configurations, and tap Create. It creates a configuration container to store Cloud Services. Ensure that the folder name does not contain any space.

  4. Navigate to Tools hammer > Cloud Services > Microsoft® Power Automate Dataverse and open the configuration container you created in the previous step.

    NOTE

    When you create an Adaptive Form, specify the container name in the Configuration Container field.

    1. On the configuration page, tap **Create** to create Microsoft® Power Automate Flow Service configuration in AEM Forms.
  5. On the Configure Dataverse Service for Microsoft® Power Automate page, Specify the Client ID (also referred to as Application ID), Client Secret, OAuth URL and Dynamic Environment URL. Use the Client ID, Client Secret, OAuth URL, and Dynamic Environment URL of Microsoft® Azure Active Directory Application you created in the previous section. Use Endpoints option in Microsoft® Azure Active Directory application UI to find OAuth URL

Use Endpoints option in Microsoft Power Automate application UI to find OAuth URL
Use Endpoints option in Microsoft® Power Automate application UI to find OAuth URL

  1. Tap Connect . If asked, login to your Microsoft® Azure Account. Tap Save.

Create Microsoft® Power Automate Flow Service Cloud Configuration.

  1. Navigate to Tools hammer > Cloud Services > Microsoft® Power Automate Flow Service and open the configuration container you created in the previous section.

    NOTE

    When you create an Adaptive Form, specify the container name in the Configuration Container field.

    1. On the configuration page, tap **Create** to create Microsoft® Power Automate Flow Service configuration in AEM Forms.
  2. On the Configure Dataverse for Microsoft® Power Automate page, Specify the Client ID (also referred to as Application ID), Client Secret, OAuth URL and Dynamic Environment URL. Use the Client ID, Client Secret, OAuth URL, and Dynamics Environment ID. Use Endpoints option in Microsoft® Azure Active Directory application UI to find OAuth URL. Open the My flows link and tap My Flows use the ID listed in URL as Dynamics Environment ID.

  3. Tap Connect. If asked, log in to your Microsoft® Azure Account. Tap Save.

Publish both the Microsoft® Power Automate Dataverse and Microsoft® Power Automate Flow Service Cloud Configurations

  1. Navigate to Tools hammer > Cloud Services > Microsoft® Power Automate Dataverse and open the configuration container you created in the previous Create Microsoft® Power Automate Dataverse Cloud Configuration section.
  2. Select the dataverse configuration and tap Publish.
  3. On the Publish page, select All Configurations and tap Publish. Publish both Power Automate Dataverse and Power Automate Flow Service Cloud Configurations.

Your Forms as a Cloud Service instance is now connected with Microsoft® Power Automate. You can now send Adaptive Forms data to a Power Automate flow.

Use the Invoke a Microsoft® Power Automate flow submit action to send data to a Power Automate Flow

After you Connect your Forms as a Cloud Service instance with Microsoft® Power Automate, perform the following action to configure your adaptive form to send captured data to a Microsoft® flow on form submission.

  1. Log in to your Author instance, select your Adaptive Form and click Properties.
  2. In the Configuration Container, browse and select the container created in section Create Microsoft® Power Automate Dataverse Cloud Configuration, and tap Save and Close.
  3. Open the Adaptive Form for editing and navigate to Submission section of the Adaptive Form Container properties.
  4. In the properties container, for Submit Actions select the Invoke a Power Automate flow option. A list of available Power Automate flows becomes available Power Automate flow option. Select the required flow and Adaptive Forms data is submitted to it on submission.

Configure Submit Action

NOTE

Before submitting the Adaptive Form, ensure that the When an HTTP Request is received trigger with below JSON Schema is added to your Power Automate flow.


        {
            "type": "object",
            "properties": {
                "attachments": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "filename": {
                                "type": "string"
                            },
                            "data": {
                                "type": "string"
                            },
                            "contentType": {
                                "type": "string"
                            },
                            "size": {
                                "type": "integer"
                            }
                        },
                        "required": [
                            "filename",
                            "data",
                            "contentType",
                            "size"
                        ]
                    }
                },
                "templateId": {
                    "type": "string"
                },
                "templateType": {
                    "type": "string"
                },
                "data": {
                    "type": "string"
                },
                "document": {
                    "type": "object",
                    "properties": {
                        "filename": {
                            "type": "string"
                        },
                        "data": {
                            "type": "string"
                        },
                        "contentType": {
                            "type": "string"
                        },
                        "size": {
                            "type": "integer"
                        }
                    }
                }
            }
        }

On this page