Forms CS and Microsoft Power Automate

Invoke your power automate flows on an Adaptive Form submission. The following video shows the steps needed to configure and integrate Forms CS with Microsoft power automate.

In this video, we will take a look at integrating AEM Forms with Microsoft Power Automate. The first thing we need to do is to create and register an app in Azure Active Directory. So for that, I logged into using my company email address as my login account. And here, I’m going to go into Azure Active Directory here, and click on add, and select app registrations. Here, give a meaningful name. I’m going to call it AEM Forms CS and Power Automate. You can accept the default settings here, and click on register.
Now that the application is created, we need to specify some more settings. The first thing is we need to provide some API permissions for this particular app. So click on API permissions here, and add permissions, and select flow service here, and make sure you give flow manage all and read all permissions here, and click on add permissions.
And the next permission you need to give is on Dynamics CRM. So select Dynamics CRM here, and select the user impersonation, and click on add permissions. So these are the permissions that your application would need. The next thing we need to do is to provide end point URLs for successful authentication to return to. So for that, you go into the authentication here, and click on add platform, and select web here. So here, we need to provide a set of redirect URLs Whenever you are configuring AEM Forms to integrate with Microsoft Power Automate. So these URLs will be in this format. Only thing that will change is your instance name here. So let’s copy these two URLs. So there are two URLs, one for Dataverse, and other one is for flow service. So I copy this URL, and paste it into this here, and click on configure.
And then we can add the second URL for flow service here. So these URLs, like I said, will be the same, only the server name will be different in your case. So for example, in my case, the server name is
In your case, that will change. But the rest of the URL will remain the same. So we need two URLs, one for Dataverse, another one is for flow service. And then, so we add another URL for flow service.
We don’t need this, so we need two URLs, and then save.
The next thing we need to do is to create a private key here. So these are the certificates. So here we are going to create a new client secret. So we’re going to enter a description here.
Client secret. And it’s recommended is for six months you can change whatever timeframe you want for this. I’m going to stick with the default, and click on that.
So here is the value, client secret value here, so make sure you copy this, and save it in a secure location, because you will be needing that at a later point. Now that our Azure AD app is registered, we need to get hold of the client ID, client secret, OAuth URL, and the environment ID, and the instance URL. Let’s start with getting the client ID and the client secret. To do that, I have logged into my portal,, and go into the app registrations, and open up the app that you registered earlier. So from here, you can get the client ID, and then the client secret was got from here. When we created the app, remember, we made a note of this client secret here. So those are the two keys, and then we need to get hold of the OAuth instance URL. So go to the endpoint here, and make a copy of this, OAuth 2.0 authorization endpoint. So this is what we will need when you are configuring cloud services configuration in AEM, so make a note of this URL. The next URL we need to get is the instance ID and the environment ID, so for that, I’ve logged into Power Automate here, and clicked on my flows here, and what you see after environments is the environment ID here. So make a note of this environment ID here. That’s the environment ID, up to here, make a note of that. And the other thing you need is an instance URL that can be provided to you by your administrator. So these are the four or five settings, or the values that you need, the client secret, client ID, environment ID, instance url. This is what your administrator will be able to provide to you, and the oAuth URL, which we got from the endpoint here. So once you have these values, the next step is to create the cloud services configuration in AEM. We are now ready to create our cloud service configuration, which will allow us to integrate AEM Forms cloud service with Microsoft Power Automate. So to do that, I’ve logged into my AEM instance, and I’m going into the cloud services here. And there are two cloud services configurations that we need to create. One is for the Microsoft Power Automate Dataverse, and other one is for the flow service. So let’s start with the Dataverse. Click on this, and select the configuration container that we had created earlier. So it’s going to be FormsAndPowerAutomate. So click that, and click on create.
So here we need to provide the client ID, client secret, oAuth URL, and the Dynamics environment URL. So we have this from the earlier video. So let’s copy and paste those values in here. So I’m going to select the client secret.
Client ID.
Client ID. OAuth URL.
That’s the OAuth URL.
And the Dynamics Environment URL. This is the URL which your administrator should be able to give you.
So the instance URL, that’s the Dynamics URL here.
Here. Now we are ready to connect. So click on connect.
So authentication was successful. Make sure you click on save.
So one configuration is created. The next thing to do is to create the second configuration for the flow service. So we go into cloud services here, and select the Microsoft Power Automate flow service, and select your configuration container, that was FormsAndPowerAutomate, and click on create. So here, we also need to provide the same values, for instance, the client ID, the client secret, Oauth URL, and here you are to provide the environment ID. So let’s provide the client ID and the client secret first.
Client ID.
Client ID.
Let’s do the client secret.
Client secret. OAuth URL.
Oauth URL. And the environment ID. So the environment ID is here.
And click on connect.
So the connection was successful. And save your configuration settings here. So now that you have created these configuration settings, the next step is to create and form, and configure the form to submit to a Power Automate workflow.
On the Microsoft Power Automate site, I have created a simple flow, or a workflow, which would send an email on form submission. Now to make this workflow available on the AEM Forms site, you need to add it to a solution. So here I have a solution called AEM Forms. And in that solution, I’ve added the flow that I showed you earlier. So this is my solution. And in that solution, I have added, I have added the flow here. To add a flow to your solution, you simply have to click here, and oh, you have to click here, and add an existing cloud flow here. And then it will show you the list of flows that you have created, and you can pick and choose which flows you want to add to the solution. One more thing I want to point out is make sure the solution owner and the flow owner are the same. In my case, this is Girish Bedekar. I am the solution owner, as well as the flow owner. Now that your solution is created, we are now ready to integrate or hook up an AEM Forms submission to trigger this particular flow on the Microsoft Power Automate site.
Now that we have created the necessary cloud services configurations and the Power Automate workflow it’s time to configure an adaptive form to trigger in Microsoft Power Automate workflow. So to do that, I’ve logged into my AEM Forms cloud service instance, and I’m going to create a new adaptive form, using the new visit driven approach.
So in the new visit driven approach for creating a form, you are presented with the basic template presented with all the available templates that you can choose to base your form on. So in my case, I’m going to select the basic template here, and I’m going to select a style, or the style sheet here. So I’m going to select, let’s say, tranquil. And in the submission options, I can select the invoke a Microsoft Power Automate flow. And then I click on create to create the adaptive form, and give a name here.
Test Power Automate.
So the form will be created with the necessary themes or the style sheet, and the submission options already configured here. So if you were to go and check the form container level here, under the submission options, you would notice that the form is configured to submit to a Power Automate workflow. But then we don’t see the name of the flow, and the name of the solution, and the flow that you want to trigger. That is because our form is not associated with the configuration container that contains the cloud services configurations. So to do that, you go back to your form here, select the form, and click on its properties here.
And in the configuration container, make sure you select the same configuration container that has the configuration settings of the cloud services configurations. And remember, we had created our configuration settings in the Forms and Power Automate configuration folder here. So select that, and click on save and close. Now, if you go back to your form and refresh here, and open up the form container properties, and go into the submission options here, you see here Power Automate workflow. So which solution and which flow you want to do it. So here it says, send email on form submission. So that is the flow that you want to trigger whenever this particular adaptive form is submitted. So this is how you would integrate AEM Forms with Microsoft Power Automate, and trigger a workflow on the Power Automate site when an interactive form is submitted. -