web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to delete REMOVE r...
Power Apps
Answered

How to delete REMOVE row in SQL table

(0) ShareShare
ReportReport
Posted on by 25

Is is possible to delete single row in sql table from powerapps Icon. I am using gallery to add miltiple line item.

I am able to collect and Patch to SQL . I am able to remove from collection single row Remove(CollectionName, ThisItem) but not sure how to do similar thing for SQL any help will be appriciated.

Regards,

najruli

Categories:
I have the same question (0)
  • timl Profile Picture
    36,785 Super User 2026 Season 1 on at

    Hi Najruli,

    A simple way to remove a single row from a SQL Server table is to call the RemoveIf function and to provide a primary key value. As an example, here's how to remove a row from a customer table where CustomerID=8.

    RemoveIf('[dbo].[Customer]', 
     CustomerID=8
    )
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @najruli ,

    Could you please share a bit more about your scenario?

    Do you want to remove same record from your SQL Table when you remove single row from your Collection?

    Further, do you collect the new items into a Collection, and then patch the Collection into your SQL Table?

     

    If you want to remove one record from your SQL Table, you must find the record in your SQL Table firstly. I have made a test on my side, please take a try with the following workaround:

    Add the following formula within the "Remove" icon within your Gallery:

    Remove(
     '[dbo].[YourSQLTable]',
     LookUp('[dbo].[YourSQLTable]', PrimaryColumn = ThisItem.PrimaryColumn) /* <-- Find the reocrd you want to update */
    )

    Note: The PrimaryColumn represents the Primary column in your SQL Table, which could identify one record uniquely.

     

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

    LookUp function

     

    Best regards,

  • Verified answer
    najruli Profile Picture
    25 on at

    In fact, Instead removing rows directly from SQL Table, I created collect table which was easy add and delete Line Items after finishing my adds into collect then I added another Button where I saved all the Collect table to SQL Table.
    Save Collect Table to SQL Table Code :

    ForAll(CollectTable,
                                                  Patch( SQL_Table, Defaults(SQL_Table),
                                                       {

                                             ID: ID,
                                             Name: Name,

                                             Address: Address,

                                            Email: Email

                                                       }

                                           )

    );

    Note: Collect Columns must match SQL Table Columns Names.

     

    Regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard