Connect and submit Adaptive Form data to Microsoft® Power Automate connect-adaptive-form-with-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 AEM Forms Author 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
  • An Experience Manager user with Forms Author and Forms Admin privileges
  • Account used to connect to Microsoft® Power Automate is owner of the Power Automate flow configured to receive data from Adaptive Form

Connect your AEM Forms instance with Microsoft® Power Automate connect-forms-server-with-power-automate

Perform the following actions to connect your AEM Forms Author instance with Microsoft® Power Automate:

Create Microsoft® Azure Active Directory Application ms-power-automate-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://[AEM Forms Author instance]/libs/fd/powerautomate/content/dataverse/config.html
    • https://[AEM Forms Author instance]/libs/fd/powerautomate/content/flowservice/config.html

    Register a Azure Active Directory Application

    note note
    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 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, select Create.

  3. In the Create Configuration dialog, specify a Title for the configuration, enable Cloud Configurations, and select 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 note
    NOTE
    When you create an Adaptive Form, specify the container name in the Configuration Container field.
  5. On the configuration page, select Create to create Microsoft®® Power Automate Flow Service configuration in AEM Forms.

  6. 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

  7. Select Connect . If asked, login to your Microsoft® Azure Account. Select Save.

Create Microsoft® Power Automate Flow Service Cloud Configuration create-microsoft-power-automate-flow-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 note
    NOTE
    When you create an Adaptive Form, specify the container name in the Configuration Container field.

    1. On the configuration page, select **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 select My Flows use the ID listed in URL as Dynamics Environment ID.

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

Publish both the Microsoft® Power Automate Dataverse and Microsoft® Power Automate Flow Service Cloud Configurations publish-microsoft-power-automate-dataverse-cloud-configuration

  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 select Publish.
  3. On the Publish page, select All Configurations and select Publish. Publish both Power Automate Dataverse and Power Automate Flow Service Cloud Configurations.

Your AEM Forms Author 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 use-the-invoke-microsoft-power-automate-flow-submit-action

After you Connect your AEM Forms Author 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 select 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 under the 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"
                        }
                    }
                }
            }
        }

See also,

recommendation-more-help
19ffd973-7af2-44d0-84b5-d547b0dffee2