Are you a Power Apps developer who deals with system integration needs across a business? Someone who works with JSON, or other data formats, and has found yourself in a position where the standard functions (Compose, ParseJSON) just don’t provide enough functionality and you need something more powerful? On top of that, you don’t want to start writing C# code for plugins, Azure Webjobs, or even Azure Functions? This might be the blog for you. In this blog I take a low-code approach to system integration using Microsoft Power Apps, Azure, and Liquid templates.
This blog intends to demonstrate the following:
- Power Apps integration with other systems through the use of an Azure Service Bus and an Azure Logic App
- Use of the Power Apps Web API through a Logic App
- Transformation of data using Liquid Templates for preparing data to be sent in a Web API call
Here are the steps used to complete this exercise:
Identify the schema. For this blog we are going to simulate new contact data coming in from a different system, then processing that with our Logic App and inserting the data into Power Apps. We will use out-of-box Contact fields for everything except a SSN and Drivers License Number.
Here are the fields we’ll be using for this exercise.

Create an Azure Service Bus and Queue. Other systems around the enterprise can send messages here. The Azure Logic App will monitor this queue and process messages.

Create a console app. This app will be used to push data to an Azure Service Bus (queue), essentially simulating the other systems sending messages for our Logic App to process. You can follow the steps here to accomplish this.


Create an Azure Integration Account. This will be used to store our Liquid Template and provide transformation services. You can follow the steps here to accomplish this.

Create a Liquid Template. This will provide the transformation instructions so we can control how our data will look once the transformation is complete. You can check out how to do this, and add it to the Azure Integration Account, here. In the screen shot below you’ll see the template using Visual Studio Code with the Liquid Languages Support extension. You should notice a couple of things here…
- The “message” and “contact” variables at the top, designated by the assign keyword, and how they map to the JSON above in our test data.
- The field names on the left at the bottom. Those are our internal Power Apps field names.
- The result of this transformation is an output that we can simply drop into the body of a Web API call to Power Apps. If you look at the second screen shot in Cmdr using the local Liquid Template tools, you can see the output of the transformation that used the above JSON as input, and the template below for the transformation.


Create our Azure Logic App. Here we’ll create a very simple Logic App that monitors our queue, then uses the Azure Integration Account we set up above to transform incoming data and ultimately pushing that data into our Power Apps database.
The first thing we need to do is make sure that we’ll be able to make API calls against our Power Apps API from the Logic App. That means we need to set up an App Registration in Azure, for our Power Apps environment. There are posts out there on how to do this, but often times the App Registrations for services in the same tenant will already be ‘mostly’ set up for our needs. In the App Registrations screen shot below, you can see that there is a registration for the Microsoft Common Data Service. If there is no green checkbox under the Certificates & secrets column, simply click into the App Registration and add a new client secret.


Once the app registration is complete, you’ll want to either set up an Application User in your Power Apps environment, or set up API permissions on your App Registration in Azure. You can read about the latter of those options here, for this write-up though we’ll use an Application User in Power Apps. Use the information from the App Registration Overview area in Azure to fill in the values needed for the new Application User.
Once the Application User has been created, make sure to assign it a Security Role. For demo purposes I’m just assigning mine the System Administrator role, although you should never do this in a live system.

When you first select to create a new Logic App, you can select from several different common triggers. We are going to select “When a message is received in a Service Bus queue”.

Assuming you haven’t set up a connection yet, we’ll first set up a connection through the Service Bus trigger step. Give the connection a name, then select the name of the Service Bus Namespace that you want to use for this Logic App. The available namespaces should be listed in the step.

After you select the namespace, you should see the Service Bus Policy associated with that namespace. Go ahead and select that and then click Create.

Once the connection has been created you’ll want to select the queue you want your trigger to monitor and how often you want the Logic App to check the queue for messages. Make sure to save the Logic App once complete.

Now we want to add a variable (Initialize Variable step) as an object type, and set the value to the body of our message that our Logic App just picked off of the queue. Because the message is encoded upon arrival, we’ll need to use a function in our value setting.
json(base64ToString(triggerBody()?[‘ContentData’]))

Next we want to add our Liquid Transform JSON to JSON step. Yes… Azure has an out-of-box step for this!

If you receive this error that says “There is no Integration Account associated with this Logic App”, fear not. Simply remove that transform step from the Logic App, save the Logic App, and go back to your Logic App’s Workflow Settings to set the Integration Account that your Logic App should use.


Once you’ve set the Integration Account on the Logic App, you should be able to pick the Liquid ‘map’ that you set up with the Integration Account. Last thing to do on this step is to set the Content parameter to the message-content variable we initialized above.

Finally we add our HTTP step. Set the URI to the Web API contacts URI as seen in the screen shot. Then you’ll want to add the Headers parameters for “Accept”, “Content-Type”, “OData-MaxVersion”, and “OData-Version”. Set the Authentication type to Active Directory OAuth, and use the Tenant and Client ID GUIDs from the App Registration in Azure, and use the Secret from the App Registration that you should have copied when it was first created. Use the “Transformed content” for the Body.

Finally, save the Logic App and head back to our console app that we created so we can send our Logic App its first message.


Now let’s take a look in our Power Apps database for our new record.

I hope this was helpful in demonstrating just another way we can perform system integration with Power Apps and other systems, while using some other cool technologies. Feel free to hit me up if you have any questions.
Recent Comments