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

Function Remove has some invalid arguments - have tried everything, but still not working

Hi guys,

 

This is driving me insane. I want to delete a record from Gallery.

I'm trying to delete a record in other SP list based on ID from Gallery (Gallery is feed from different list).

I manage to get the ID from the SP list where I want to delete that record, but I cannot delete it.

 

1st picture is showing ID after clicking on the Gallery item

2nd picture is showing exactly that ID in SP list

3rd picture is showing error

 

GalleryID.PNGSP_ID.PNGRemoveID.PNG

 

I don't understand why I just cannot call the list, give an ID and delete that record, because this is exactly what I'm doing 😞

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@AnthonyJrJr 
The Remove function requires your source table as the first parameter, and the record you want to remove or a table of records as the second.

You are providing the second parameter as an equality formula.  So, it will result in either true or false...which will not be a record or a table, so it is not valid.

If you are trying to remove the record from within the gallery row, then the formula can be: Remove(yourList, {ID: ThisItem.ID}) or RemoveIf(yourList, ID=ThisItem.ID)

 

You mention that your record is in some other list other than the gallery list, so perhaps the above to options give you a clue.

 

If not, then post back with a little more detail on where you are performing this function and about the different list and the relationship to the gallery.

 

I hope this is helpful for you.

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@AnthonyJrJr 
The Remove function requires your source table as the first parameter, and the record you want to remove or a table of records as the second.

You are providing the second parameter as an equality formula.  So, it will result in either true or false...which will not be a record or a table, so it is not valid.

If you are trying to remove the record from within the gallery row, then the formula can be: Remove(yourList, {ID: ThisItem.ID}) or RemoveIf(yourList, ID=ThisItem.ID)

 

You mention that your record is in some other list other than the gallery list, so perhaps the above to options give you a clue.

 

If not, then post back with a little more detail on where you are performing this function and about the different list and the relationship to the gallery.

 

I hope this is helpful for you.

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes thank you, but now I'm facing other issue. My expression now is correct, but no records are deleted.
 
RemoveIf(List_Prijave, EmPolaznik = varUser.mail && List_Prijave.TerID = ThisItem.ID)
 
Incompatible types for comparison. Table and Number.
 
"TerID" is not default ID of "List_Prijave" SP list, it's some other ID I've passed (one to many relationship).
I'm checking TerID and logged user email in order to delete the record from the list, this should be ok, but nothing happens.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,632)