Calculated fields in a table when editing data

Hi there. I have 2 questions which I think are related, and could do with some guidance on.

  1. I have an editable number field in the table below (Quantity Shipped), and I would like to be able to only allow values to be entered that are between 1 (as the minimum) and the value of the Print Quantity column as the maximum. Not sure if this is possible with an editable table field?

  2. As an alterative to the above, I am looking to create a calculated field. I am wanting to calculate Print Quantity - Quantity Shipped and display the answer in the Quantity Remaining column. The difficulty I am having is that the Quantity Shipped field is editable, and I am struggling with getting the edited value for the correct row into my calculation.

If anyone has any thoughts, it would be much appreciated

Many thanks
Adam

Hi @turps808!

I don't know that 1. is possible with editable table fields at the moment. As for 2. you can check the changeSet for your table and return that value if it exists using something like table.changeSet[i]?.print_quantity ?? currentRow.print_quantity.

Here we're referencing the changeset using the row's index i, checking if there's actually a change in Print Quantity there, and then referencing currentRow object of the underlying data for that value otherwise.

Let me know if that works?

Many thanks for getting back to me. I'll give this a go, and let you know what the outcome is