Dynamic way of creating the Request

Hello,

We are pretty new to Gatling , We are trying to optimize the scala code generated for one of our requests which is as below . How do we generate the request dynamically for such requests wherin the key and value changes based on the no of elements displayed . In the sense if there are 4 elements displayed then the next action generated the below code with keys and values updated in arrays.

If we have 1000 elements dispalyed then the code looks too long and is not the right approach .

.formParam(“update_array[0][message_id]”, “MES-48239b313fa3ff0b-e792747a00000000”)
.formParam(“update_array[0][key_indicator_id]”, “AWdeV9o6L8c8W5OAuF5u”)
.formParam(“update_array[0][status]”, “follow-up”)
.formParam(“update_array[0][version]”, “4”)
.formParam(“update_array[0][assignee]”, “admin”)
.formParam(“update_array[0][resolved]”, “false”)
.formParam(“update_array[0][comment]”, “”)
.formParam(“update_array[1][message_id]”, “MES-4876b8972009db3d-d6e1b17700000000”)
.formParam(“update_array[1][key_indicator_id]”, “AWdeV9o6L8c8W5OAuF5u”)
.formParam(“update_array[1][status]”, “follow-up”)
.formParam(“update_array[1][version]”, “4”)
.formParam(“update_array[1][assignee]”, “admin”)
.formParam(“update_array[1][resolved]”, “false”)
.formParam(“update_array[1][comment]”, “”)
.formParam(“update_array[2][message_id]”, “MES-4875f740316d3186-f606a0900000000”)
.formParam(“update_array[2][key_indicator_id]”, “AWdeV9o6L8c8W5OAuF5u”)
.formParam(“update_array[2][status]”, “follow-up”)
.formParam(“update_array[2][version]”, “4”)
.formParam(“update_array[2][assignee]”, “admin”)
.formParam(“update_array[2][resolved]”, “false”)
.formParam(“update_array[2][comment]”, “”)

Thanks and Regards
Sudhakar Reddy

Any insights please , need it real quick as the whole request sending for different scenarios depend on the solution.

Best Regards
Sudhakar Reddy