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

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
v-xida-msft
Community Support
Community Support

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.
Anonymous
Not applicable

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

 

Thank you,

 

@Anonymous 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,581)