cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ysharma
Frequent Visitor

Inserting multiple rows in SQL Server table

Hello All - 

I am trying to insert multiple rows into a sql server table, I see the current action is only capable of inserting one row at a time. Is there a way we can insert multiple rows into the sql server table? Please feel free to throw in any idea.

Thank you.

4 REPLIES 4
gabibalaban
Super User
Super User

@ysharma ,

There is no action in Power Automate to insert multiple rows into SQL Table, but you can do it by using Apply to each action with the concurrency option set as you need (maximum 50) and inside Apply to each action the SQL - Insert Row (V2) action.

 

gabibalaban_0-1638428215243.png

Hope it helps !

Hi @gabibalaban ,
Thank you so much for your response. I tried to put the "Insert row" action with in "Apply to each" and set the concurrency, but I am not sure what array to put here:

ysharma_0-1638451937301.png

When I put body from previous step I am getting the below error, and getting the same error when I am putting id from previous table.

ysharma_1-1638451989948.png

Thank you again for helping me out.

Hvus
Frequent Visitor

Hi!

Did you try to use bulk insert instead insert into?  This is the fast method to masive insertion.

Hope this help.

@ysharma ,

Based on your screen-shot, for each created item in table 1 an instance of the flow runs and creates a row in table 2. 

I can't figure it out what multiple rows do you want to insert in the second table. The body property of the trigger SQL - when an item is created is an object (the columns values of the created item) , not an array, so you cannot use Apply_to_each action in this case.

 

Helpful resources

Announcements
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Users online (1,981)