Problems in using Loop for executing Gatling Scenarios

I want to execute some test steps in the loop based on the JsonObject. I wrote the following code but i guess we cannot execute chain builders withing session block.
Can someone explain how can i execute the steps in loop based on the elements in the List of JsonObject.? I saw the documentation but still not clear. If someone has any sample code please let me know

session => {

val temp= session.get(“pa”).asOption[String]

tempmatch {
case Some(map: String) => {
val jsonAst = map.parseJson
jsonObject= jsonAst.convertTo[SavingsJsonObject]
for(pa< {
for(tempAcc<- pa.tempAccount) {
//steps to be called per Object information
} }

case None => println("\n “)
case other => println(”\n " + other)