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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,865)