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

Update Excel from SQL

I am trying to mirror an excel file from a SQL database. If the SQL entry does not exist in the excel file, it will 'add row into table'. If it does exist , then it will 'update a row'. But it just keeps adding rows.

see below. please advise

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @jjpreston29 ,

 

You could add a unique column in the excel table as a key column to check if the record exists.

Then you could use Filter to filter records in a table by the value of the key column in Sql table.

Use length() function to check if the record exists, if yes, update record; if no, create a new record.

If the type of key column is number, you could remove the single quote outside Dynamic content. And the unique column could not be empty.

Image reference:

35.PNG36.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

 

Hi @jjpreston29 ,

 

You could add a unique column in the excel table as a key column to check if the record exists.

Then you could use Filter to filter records in a table by the value of the key column in Sql table.

Use length() function to check if the record exists, if yes, update record; if no, create a new record.

If the type of key column is number, you could remove the single quote outside Dynamic content. And the unique column could not be empty.

Image reference:

35.PNG36.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks  - your method works. I could see from the error that my filter was not working because my unique key in the excel was "Circuit-ID" - and it did not like the "-"

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,077)