Set values in json array dynamically at runtime

I have a json like below. I want to set values in item array according to number of items which are created at runtime. I mean the number of item can change dynamically.I put this json in http body in Test Object(web service request) created in object repository. Can I create a variable for item array in Variables tab.I want this operation before sending restapi call
{
“salespersonCode”: “”,
“item”: [
{

  "logicalRef": ${logicalRef},
  "type": ${type},
  "code": "${code}",
  "description": "${description}",
  "quantity": ${quantity},
}
 ],

“masterData”: [
{
“type”: 8,
“number”: “2020-00000000002”,
“date”: “2020-09-16T09:30:16.000+03:00”,
“boField”: null,
“restProfileFields”: null
}
],
}