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

Replace entire SQL table with new data

Good day everyone

I am attempting to create a flow, triggered in Power BI that will send an approval email containing a table of data and once approved the data within a specified sql table needs to be completely replaced with this new data.
This is what I have managed so far

L3P_0-1655844436827.png

So at the moment when I press the button in PowerBI it send a recipient an approval email, once approved it writes the data into the specified sql table. Problem is it only add the data to the table, so the old data is still there. I need it to completely replace all of the data.

I was considering using Update rows but I ran into another obstacle. The data inserted into the table is not always the same length, example sometimes I have 5 rows to insert and other times 15. 
Is there a way to work around this somehow? Perhaps by deleting all the old data first and then reinserting the new data or something? I'm just not sure how to go about this.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @L3P ,

 

Yes. If the request is approved, you could delete all items firstly and then insert new rows.

Sample:

vxiaochenmsft_0-1656038711168.png

 

Best Regards,

Wearsky

View solution in original post

1 REPLY 1
v-xiaochen-msft
Community Support
Community Support

Hi @L3P ,

 

Yes. If the request is approved, you could delete all items firstly and then insert new rows.

Sample:

vxiaochenmsft_0-1656038711168.png

 

Best Regards,

Wearsky

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,460)