There is a script that receives data from the request. I send count - it means the number of parameters that must be obtained, and the parameters themselves in the following form: product1 productQuant1 , product2 productQuant2 , that is, in this case, count=2 . The task is to extract all parameters in a loop, referring to them by name, composed of product + i , where i is a loop variable. I tried concatenation, does not work.
for (var i = 1; i <= count; i++) { var product = request.parameter.product + i; var productQuant = request.parameter.productQuant + i; sheet.appendRow([product, productQuant]); }