How to Form dynamic request

When I recorded my script, there were 2 item ids but when next time there can be more than 2 or1 may be. below is the request for 2 item id. I need help to make it for 3, while running the script

.exec(http(“request_26”)
.post("/isf/store/mashupController.do")
.headers(headers_26)
.formParam(“scControllerData”, “”"{“MashupRefs”:{“MashupRef”:[{“mashupId”:“isf.shipment-pick.validateShipmentForBackroomPick”,“Input”:{“Shipment”:{“ShipmentKey”:“20210730012330920805”,“Action”:“BackroomPick”}}}],“isMultiAPICall”:false}}""")
.formParam(“scCSRFToken”, “${scCSRFToken}”)
.formParam(“scFlag”, “Y”)
.resources(http(“request_27”)
.post("/isf/store/mashupController.do") //OrderNo
.headers(headers_27)
.formParam(“scControllerData”, “”"{“MashupRefs”:{“MashupRef”:[{“mashupId”:“isf.shipment-pick.getShipmentDetails”,“Input”:{“Shipment”:{“ShipmentKey”:“20210730012330920805”}}},{“mashupId”:“isf.shipment-pick.getAllPickableShipmentLineList”,“Input”:{“Shipment”:{“ShipmentKey”:“20210730012330920805”}}}],“isMultiAPICall”:false}}""")
.formParam(“scCSRFToken”, “${scCSRFToken}”)
.formParam(“scFlag”, “Y”),
http(“request_28”)
.get(“https://s7d9.scene7.com/is/image/TheBay//067730200216_main”)
.headers(headers_28),
http(“request_29”)
.post("/isf/store/mashupController.do")
.headers(headers_29)
.formParam(“scControllerData”, “”"{“MashupRefs”:{“MashupRef”:[{“mashupId”:“isf.hbc.bagging.extn_getQtyOnHand”,“Input”:{“InventorySupply”:{“ItemID”:“90396619”,“UnitOfMeasure”:“EACH”,“SupplyType”:“ONHAND”,“OrganizationCode”:“BAY”,“ShipNode”:“MFC-963-565”}}}],“isMultiAPICall”:false}}""")
.formParam(“scCSRFToken”, “${scCSRFToken}”)
.formParam(“scFlag”, “Y”),
http(“request_30”)
.post("/isf/store/mashupController.do")
.headers(headers_29)
.formParam(“scControllerData”, “”"{“MashupRefs”:{“MashupRef”:[{“mashupId”:“isf.hbc.bagging.extn_getQtyOnHand”,“Input”:{“InventorySupply”:{“ItemID”:“90186422”,“UnitOfMeasure”:“EACH”,“SupplyType”:“ONHAND”,“OrganizationCode”:“BAY”,“ShipNode”:“MFC-963-565”}}}],“isMultiAPICall”:false}}""")
.formParam(“scCSRFToken”, “${scCSRFToken}”)
.formParam(“scFlag”, “Y”),
http(“request_31”)
.get(“https://s7d9.scene7.com/is/image/TheBay//667142460279_main”)
.headers(headers_28)))

This is something which I will be interested to know as well. I too have something similar issue.

Maybe Stéphane can throw some light on it.

The only way to have different numbers of resources I can think of is to materialize each possibility and use a doSwitch.