Check if duplicate object already exists within GET before POST

Hi @nils

I believe that the functionality you are looking for can be done by setting the disable condition on your button to something like the following

{{query1.data.filter(x=> _.isEqual(table1.selectedRow.data, x)).length >0}}

This is checking if there are any objects in the table that are exactly the same as the row you have selected in your table, and if so, the button is disabled.

If instead you just need to check a certain property you could do something like this:

{{query1.data.filter(x=> table1.selectedRow.data.id == x.id).length >0}}

Screen Recording 2021-09-14 at 1.04.41 PM

1 Like