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 / Delete function inside...
Power Apps
Answered

Delete function inside delete button not working

(0) ShareShare
ReportReport
Posted on by 20

I have a delete button in my form screen, that i want to configure its OnSelect formula to remove a form record that the user created. Im using SQL database as input for the form, and the table name is [dbo].[Escopo], the form name is Form1. I have tried : Remove('[dbo].[Escopo]', Form1.Selected)

But, it gives me a Paren Close error, but i dont understand, what is wrong with it??

 

 

Note: SQL tables are created on my database, but has no values associated with the table, as I want this values created by the user after filling the forms and after clicking on submit button.

Categories:
  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @SamuelMDC26 ,

    Can you try this:

    Remove('[dbo].[Escopo]', LookUp('[dbo].[Escopo]', Id = Form1.Selected.Id)

     Id is the primary key in SQL table.

    ------------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,

    ANB

     

  • SamuelMDC26 Profile Picture
    20 on at

    I tried the exactly same formula, but it still gives me this "Unexpected caracters, formula have errors, ParenClose expected. 

  • SamuelMDC26 Profile Picture
    20 on at

    The only thing that worked until now is the save button, im using SubmitForm(Form1), but the remove function is always in this parenclose thing

  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    @SamuelMDC26 Can you share the exact error message or screenshot?

     

    Thanks,

    ANB

  • SamuelMDC26 Profile Picture
    20 on at

    here it is

    error parenclose es.png
  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    @SamuelMDC26 I dont see any message. Can you hover the mouse on red cross and take screenshot.

     

    Thanks,

    ANB

  • SamuelMDC26 Profile Picture
    20 on at

    sorry, the error didnt show on the earliest print , here is it again

    error parenclose updtaed.png
  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    @SamuelMDC26 : Also the code will work when there is any data which is coming from source and shown in form. If there is not data on form and if you simply click on delete button then yes you will get some error.

     

    Does your form is mapped to source?

     

    Thanks,

    ANB

  • SamuelMDC26 Profile Picture
    20 on at

    I think it may be the problem. I dont have any data other than the tables name created on the database(dont have values in the tables). I also don't have any form submitted, so it may understand that it does not have anything to delete, I will try to create and save a form or populate the tables and return here

  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    @SamuelMDC26 : Apologies, there is no such property for form called as "Selected" .

    I tried from my end. I am showing the record in one gallery and that is gallery1 and after record is selected then that record it is shown in the form. The form item property will be Gallery1.Selected and data source property will be '[dbo].[Escopo]' and then used the below code on delete button:

     

    Remove(
     '[dbo].[Escopo]',
     LookUp(
     '[dbo].[Escopo]',
     ID = Gallery1.Selected.ID
     )
    )

     

    ANB_1-1695130517342.png

     

    Left is gallery and right one is form.

     

    ------------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,

    ANB

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard