cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

update sql server table with excel sheet

Hi, I have an excel sheet administrated by me and I want to create a manual sync button with power automate:

 

My excel sheet does not have ID and contains culumns:

- Item

- consumables

- quantity

-...

 

Each couple Item / consumables is unic and is my key!!

 

My sql table does have the sames culumns with an ID one more:

- Table_ID (automatic increment)

- Table_Item

- Table_Consumables

- Table_quantity

 

I want to create an manual button that will list all the items of the excel and:

- update if the couple Item / consumable is found in the sql table

- insert a new row if the couple is not found

- Delete existing row in the Table if this row is not listed in the excel sheet

 

Thank you in advance for your help

3 REPLIES 3
Highlighted
Dual Super User
Dual Super User

Re: update sql server table with excel sheet

Hi @Kesh 

 

For the Update and create row option, you can follow the below: 

ql1.PNG

 

ql2.PNG

 

ql3.PNG

 

At the end of the flow, add an action to terminate the flow as successful. 

 

For the delete part, 

 

You can list rows from the SQL table and then check for each item if it is present in the excel and if not delete those. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Helper II
Helper II

Re: update sql server table with excel sheet

Hi @yashag2255 

 

thank you very much for your help, I just adapted your solution from get rows (count 1) to get row and I had some issue with to insert float  values with azure sql but I found the solution.

Every item is perfectly modified or added.

My issue now is that I can't continue to remove items because the flow doesn't want to quit the first loop:

image.png

 

 

Thank you very much for your help

Highlighted
Dual Super User
Dual Super User

Re: update sql server table with excel sheet

Hi @Kesh 

 

For the delete rows from SQL part, you will have to create a new flow. It will not run with this one as you will end up getting stuck in the loop. 

 

The cleaner way is to create a separate flow for the delete items part. 

 

Hope this helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (6,318)