How to add the number of unit for each item and the "out of stock" message for my e-commerce app

If you’re using a form to write the new row to the purchases sheet, you can pass the RowID automatically by using Screen Columns.

The UI is outdated in the video, but the process is identical: