{tocify} $title={Table of Contents}
I have covered creating instance of Logic App in last post so will directly go to creating Logic App,first step is to add the trigger to start the LA, a HTTP endpoint
The trigger is also supposed to accept Request message and for that there is provision to provide a schema for it (it is optional), in last post I haven't provided schema, here I intend to show the use of providing it. Click on Use Sample payload to generate schema, in the popped up editor provide the sample payload and click ok.

I’ve used the same payload as a sample message to generate the JSON schema.The JSON schema validates the incoming request and is useful for helping subsequent workflow steps know which properties to reference. Just like disassembler in BizTalk promotes properties here Trigger does that based on schema defined.

Add next action as For each, and as you can see above , Products is available as parameter to be used in For Each. Glad to see that apart from Body(which is available to all ), Products which is an array is only available(which is valid parameter)

Select the Products and click on Add an action and add SQL connector . As am using same table used in previous post I don't have to specify connection details again rather would use same connection.

Select Insert Row, you will see Product table gets available in dropdown list. Here if you see the properties which are valid for columns are available to choose from (Apart from Body) and this is because we have defined schema.

Assign appropriate properties against column and below is how it should look

That's it, Logic app is ready for the task

For testing I have copied the URL (which you get on Request Trigger after save) and used ARC tool to send request- data is same which I used to create schema

Finally we need to verify the entries made in DB
As can be seen above all four records have made entry in table.
Introduction
In last post we saw how to Insert a single Record in SQL Table which is on Prem using Logic App - Inserting data in On Premises SQL Database using Logic Apps
Here I intend to walk through the process of inserting multiple records using single Logic App, to do this we have two options we can choose from
1. Split On
2. For Each
So either we debatch/split the Request message and insert in table or loop through the array of records and insert in table, here I am using the later method.
Here we want multiple records thus we need to create an array of records as following-
{
"Products":[
{
"Description": "Edifice",
"ID": "123",
"Price": "3424"
},
{
"Description": "Edifice1",
"ID": "1231",
"Price": "2424"
},
{
"Description": "Edifice2",
"ID": "1232",
"Price": "2344"
},
{
"Description": "Edifice3",
"ID": "1233",
"Price": "2324"
}
]
}
Here I intend to walk through the process of inserting multiple records using single Logic App, to do this we have two options we can choose from
1. Split On
2. For Each
So either we debatch/split the Request message and insert in table or loop through the array of records and insert in table, here I am using the later method.
Input
In earlier post we had single record thus input was -
{
"Description": "Edifice",
"ID": "123",
"Price": "3424"
}
Here we want multiple records thus we need to create an array of records as following-
{
"Products":[
{
"Description": "Edifice",
"ID": "123",
"Price": "3424"
},
{
"Description": "Edifice1",
"ID": "1231",
"Price": "2424"
},
{
"Description": "Edifice2",
"ID": "1232",
"Price": "2344"
},
{
"Description": "Edifice3",
"ID": "1233",
"Price": "2324"
}
]
}
Now let's create Logic App
I have covered creating instance of Logic App in last post so will directly go to creating Logic App,first step is to add the trigger to start the LA, a HTTP endpoint
The trigger is also supposed to accept Request message and for that there is provision to provide a schema for it (it is optional), in last post I haven't provided schema, here I intend to show the use of providing it. Click on Use Sample payload to generate schema, in the popped up editor provide the sample payload and click ok.
I’ve used the same payload as a sample message to generate the JSON schema.The JSON schema validates the incoming request and is useful for helping subsequent workflow steps know which properties to reference. Just like disassembler in BizTalk promotes properties here Trigger does that based on schema defined.
Add next action as For each, and as you can see above , Products is available as parameter to be used in For Each. Glad to see that apart from Body(which is available to all ), Products which is an array is only available(which is valid parameter)
Select the Products and click on Add an action and add SQL connector . As am using same table used in previous post I don't have to specify connection details again rather would use same connection.
Select Insert Row, you will see Product table gets available in dropdown list. Here if you see the properties which are valid for columns are available to choose from (Apart from Body) and this is because we have defined schema.
Assign appropriate properties against column and below is how it should look
That's it, Logic app is ready for the task
Testing
For testing I have copied the URL (which you get on Request Trigger after save) and used ARC tool to send request- data is same which I used to create schema
On checking the LA run history, trigger was successful and LA too.
If you go one level deep , you would see For Each step has four Insert Row within it(in sample four records were used) all successful(click on Next to see status of next Insert row action)
Learn More about Logic App
- BizTalk Developer getting started with Logic App
- Getting Started with Logic Apps - Fundamentals
- Getting Started with Logic Apps - Enterprise Application Integration
- Getting Started with Logic Apps - AS2
- Getting Started with Logic Apps - EDI X12 Fundamentals
- Getting Started with Logic Apps - XML to EDI X12
- Getting Started with Logic Apps - EDI X12 to XML
- Getting Started with Logic Apps - What happened to the Request?
- Inserting Multiple Records In On Prem SQL Using Logic App
- Inserting data in On Premises SQL Database using Logic Apps
- Installing and Configuring On Premises Data Gateway - By adding user to Active Directory
- XML Batching(Aggregation) in Logic App
- Batching(Aggregating) messages in Logic App
- Debatching(Splitting) JSON Message in Logic Apps - ForEach and SplitOn
- Debatching(Splitting) XML Message in Logic Apps - ForEach and SplitOn
- Securing Logic App with Azure Active Directory authentication
- Removing ns0: prefix from xml output from BizTalk/Logic app XSLT map
- Using Managed Identity in Logic Apps for Calling Active Directory Secured Function App
- Logic Apps : Fetching ISA and GS Segment Values From Interchange Envelope and Mapping
- Logic Apps : For Each Inside a For Each - Fetching values from field in an array inside an array