Request body in json array format in post request

Hi Experts,

I have a task in which my json object eg Student consists of an array for Student Info.
Info can repeat as many times inside Student. I want to take test data from excel sheet and pass the request body in my post request. Could you help me in formation of excel sheet and how to use the array in my request object.

Hello Kat,
do you really store such structure in excel?
Usually what i do in case of complex structures - i have kind of template and based on that template i generate programmatically data i need. e.g. :
name - random string, date of birth - random date from range, class - random pick from range etc.
on parameter that will be used as unique key i usually add timestamp so i’ll be able to execute test as many times as i want.
in case i need i store generated data in db, but usually i need those data only once per TC so no storage except in variables is needed.

Can you provide me with a sample code how to pass JSON array in the script in Katalon studio.Thanks for your suggestion of generating on the fly.

example how to work with json (one of many ways)

import groovy.json.JsonSlurperdef slurper = new groovy.json.JsonSlurper()def jsonDefText = '{ "name": "John", "surname": "Doe", "options" :[{"setOption1":"valOfSetOption1_1", "setOption2":"valOfSetOption2_1","setOption3":"valOfSetOption3_1"},{"setOption1":"valOfSetOption1_2", "setOption2":"valOfSetOption2_2"}]}'  def jsonVar = slurper.parseText(jsonDefText)println jsonVar assert jsonVar.name == "John"assert jsonVar.options[0].setOption1 == "valOfSetOption1_1"assert jsonVar.options[1].setOption2 == "valOfSetOption2_2"try{	assert jsonVar.options[1].setOption3 == "valOfSetOption3_2"} catch (org.codehaus.groovy.runtime.powerassert.PowerAssertionError pae){	println pae	println "There is no such element as: jsonVar.options[2].setOption3"}jsonVar.options[1].setOption3 = "valOfSetOption3_2"try{	assert jsonVar.options[1].setOption3 == "valOfSetOption3_2"} catch (org.codehaus.groovy.runtime.powerassert.PowerAssertionError pae){	println pae	println "There is no such element as: jsonVar.options[2].setOption3"}