How to delete/remove list item without id or that has no id

Hello All,

Currently I am using Modal to display the uploaded attachments by user and they are not stored into the db until user submit the form in the screen. 

So how can I delete the item / attachment from the list that the attachment has no id yet? I am using a link placed beside each record that links to action to remove the item.

Rank: #56

Hi Junior,

You can use ListDelete from System, available both for Client and Server side:

Hope it helps.



Rank: #72

Hi Junior,

In addition to João solution, I just want to mention that List does have a CurrentRowNumber runtime property (Index of Current in the List. Ranges from [0] to [Length-1]) for each list record which you can refer while removing the respective list record.

Kind regards,

Benjith Sam

Rank: #2111


If it is your local list variable which holds your uploaded files. Then yes we can delete it. We don't need its ID. instead, you can pass the file position as an input parameter to the action while clicking that link. 

Inside the action, you can use the above list remove method as João Marques mentioned. and pass the position to this action from the input parameter.