Hi @Malcolm K
As Insert row v2 action only supports inserting a single row in the table you need to call this action n no of times as per your n records.
Yes, you can define the JSON object as below having the 60 fields that you need to insert.
[
{
"LogicAppdId":"1",
"RunDate":"20201-04-01 12:34:56"
},
{
"LogicAppdId":"2",
"RunDate":"20201-04-01 12:34:56"
}
]
Once you have your JSON object you can need to loop in through each object and call the Insert row as below.
For testing, I have defined 2 values in the Parse JSON Content field and you can update as per your requirement or user input value.
You need to update the schema as per your requirement.
Sharing Definition for your reference:
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each": {
"actions": {
"Insert_row_(V2)": {
"inputs": {
"body": {
"LogicAppdId": "@items('For_each')['LogicAppdId']",
"RunDate": "@items('For_each')['RunDate']"
},
"host": {
"connection": {
"name": "@parameters('$connections')['sql_1']['connectionId']"
}
},
"method": "post",
"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('default'))},@{encodeURIComponent(encodeURIComponent('default'))}/tables/@{encodeURIComponent(encodeURIComponent('[dbo].[MyTable]'))}/items"
},
"runAfter": {},
"type": "ApiConnection"
}
},
"foreach": "@body('Parse_JSON')",
"runAfter": {
"Parse_JSON": [
"Succeeded"
]
},
"type": "Foreach"
},
"Initialize_variable": {
"inputs": {
"variables": [
{
"name": "val",
"type": "integer",
"value": "@dayOfWeek('2021-03-28T00:30:00 +05:30')"
}
]
},
"runAfter": {
"For_each": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Parse_JSON": {
"inputs": {
"content": [
{
"LogicAppdId": "1",
"RunDate": "20201-04-01 12:34:56"
},
{
"LogicAppdId": "2",
"RunDate": "20201-04-01 12:34:56"
}
],
"schema": {
"items": {
"properties": {
"LogicAppdId": {
"type": "string"
},
"RunDate": {
"type": "string"
}
},
"required": [
"LogicAppdId",
"RunDate"
],
"type": "object"
},
"type": "array"
}
},
"runAfter": {},
"type": "ParseJson"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
}
Hope the above helps. Please let me know if you need any assistance.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.