On Cell edit, find the Id of the row

Hi all !

I want to be able to store in a variable the id of the row where the cell was edited.
So if the cell "Customer" of the row 1234 was edited then my variableId would be equal to 1234
Is there a way to do this ?

Hi @brocantcode
You can create a variable state and inside you can map the changesetArray to the id of the column that was edited.
Here is how that would look like

Hope this helps

cause having options makes me happy I figured I'd give you an alternative if you need to reuse this or something. you could use a function with an array parameter like
so you can call it with other similar tables/components with const selected_id = getChangeSetArrayID(table1.changesetArray);

It won't work since I may need to change multiple values and I don't want to clear the changesetArray because i'll save at the end

If I change only one row it works, but if i change another row before saving it wont change the Id to the last edited row

Thank you guys I used this and it worked !
{{tableInventory.changesetArray.map(x => x.ID).slice(-1)[0]}}

1 Like