Delete record at index not working as expected


I’m having some issues with deleting a record at index.

From the picture above I have 2 records. In the next step I proceed with deleting record with the amount = 1.


Now that is is deleted, in the actual array, it works correctly as it removes the record at index 1, but for some reason, in the UI it always just deletes the last record.


What am I doing wrong?

Might it be that instead of item.index, you’re passing the whole object? Also, in WeWeb (as in JavaScript) the item number one (the first one in an array) actually has the index of 0 (not 1 - that’s the second item in an array).

If the Action you’re using, is bound to the trashcan icon, and that triggers the delete (remove at index), then you need to pass only the item.index (instead of item.data).

Ah yes, sorry it was originally on index, but was testing with item.data to see if it helped. Anyways, the issue is when the same when set to item.index.

That is weird indeed. Seems like the amount is actually null? Not even the amount:2 that you show in the previous screenshot? Or?

No, I just logged in and out again, thats why. It’s only the UI part thats off.

Would it help with a loom?

It would definitely be clearer)

Might the binding be the issue? Are you binding the context.item.data.amount to the init value of your input?

1 Like

No I’m not as you can see here:

Here is the workflow to create the new object:

Yup, you need to actually bind the init value to the value of your data. Now WeWeb doesn’t know what to put in there, as you’ve not specifically told it, so it just takes whatever was there.

Worked! Thanks Broberto:))

1 Like