cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
danielmillion
Level: Powered On

Deleting/Updating rows in sql server through flow

Hello, in my current situation my only option is to use flow to insert, update and delete rows from a sql database.

My problem is in creating the flow for delete/update. Flow asks me for a table and a row id. I have a rowid column in my table, but i cannot select any table (there are no tables to select, they're all missing). 

I would be grateful to know the problem which causes sql tables to be missing from creating these kind of flows from power apps to sql server.

 

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Deleting/Updating rows in sql server through flow

Hi @danielmillion ,

Do you want to use MS Flow to delete/update rows from your SQL Table?

Have you defined a Primary Key within your SQL Table?

 

I have made a test on my side, and don't have the issue that you mentioned. Please check if you have defined a Primary Key within your SQL Table. If not, please define a Primary Key for your SQL Table, then try it again, check if the issue is solved.

If you do not define a Primary Key within your SQL Table, when you use "Delete row" action or "Update row" action of SQL Server connector within your flow, your SQL table would not be available within the Table name field.

It it an known limit within SQL Server connector, please check the following article:

https://docs.microsoft.com/en-us/connectors/sql/#known-issues-and-limitations

 

In addition, you could also consider delete or update rows from your SQL Table using PowerApps app. I have made a test on my side, please take a try with the following workaround:

If you want to delete rows from your SQL Table:

Remove(  /* <-- Delete a specific record from your SQL Table */
'[dbo].[YourSQLTable]',
LookUp('[dbo].[YourSQLTable]', PrimaryKeyColumn = "A Specific Value") /* <-- Find the specific record you want to delete from your SQL Table */
)
RemoveIf(  /* <-- Bulk delete records (which match the specific condition) from your SQL Table */
                '[dbo].[YourSQLTable]',
                FilteredColumn = "A specific value"
)

If you want to update an existing row within your SQL Table:

Patch(
          '[dbo].[YourSQLTable]',
          LookUp('[dbo].[YourSQLTable]', PrimaryKeyColumn = "A Specific Value"),
{
Column1: "xxxx", /* the Column1, Column2, ... represents the columns you want to update within your SQL Table */
Column2: "xxxx",
...
} )

More details about the Patch function, Remove function in PowerApps, please check the following article:

 

Patch function

Remove function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TopShelf-MSFT
Level 10

Re: Deleting/Updating rows in sql server through flow

Thanks for posting in the community @danielmillion - can you review the above reply and update the thread if it was helpful?

 

Thank you,

 

@TopShelf-MSFT 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,832)