cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chester64
New Member

Remove function syntax for deleting record from a SharePoint list

Need some help finding to correct Syntax for the Remove function syntax for deleting record from a SharePoint list. I've created a button and on the 'OnSelect' function I've tried the List name as the DataSource / Collection but it doesn't seem to like that. Below is the syntax I've tried to use. Any help would be very much appreciated!

 

Remove('SharePoint List',thisitem)

 

The error message says 'Invaild Name'.

1 ACCEPTED SOLUTION

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @chester64,

 

If you use the SharePoint connection to create the app automatically, you will see that in the Edit form screen, you can actually delete the whole item with below formula:

Capture.PNG

 

Please go ahead and have a test.

 

Regards,

Mona

Community Support Team _ Mona Li
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

8 REPLIES 8
Michael
Microsoft
Microsoft

This looks like it might be a simple capitalization problem. Can you try using "ThisItem" instead of "thisitem"?

That not where the issue is. I did make that change but it is still giving the same error.

 

 

 

 

Where is the control that you are trying to use Remove() in the control heirarchy? ThisItem is only valid in the context of a control like a gallery or a form. Outside of that, there is no way to know what ThisItem is supposed to refer to and may be the source of your issue.

v-monli-msft
Community Support
Community Support

Hi @chester64,

 

If you use the SharePoint connection to create the app automatically, you will see that in the Edit form screen, you can actually delete the whole item with below formula:

Capture.PNG

 

Please go ahead and have a test.

 

Regards,

Mona

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

Thank you Mona, that screen shot helped alot! The issues wasn't the Datasource as i thought but the item syntax. I was trying to use ThisItem and i noticed you had BrowseGallery1.Selected. When i changed to that it then worked. Also i added your If statement too. Thanks again!

Anonymous
Not applicable

 
Anonymous
Not applicable

I have a similar problem @v-monli-msft, but I dont want to delete the whole item... I just need to delete the Value of one item. Because I have a column number that calculates how many columns have a value and then I use that number to calculate a percentage of each item... 

 

https://powerusers.microsoft.com/t5/Building-PowerApps-Formerly/How-to-delete-number-value-of-a-Shar...

@v-monli-msft, how do we do this with larger lists?  

 

According to the Remove documentation, the Remove Function cannot be delegated.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,147)