Gatling repeat loop

Hi

I have captured all Ids using jsonPath, findall in a parameter called Para_Ids

Now I would like to use a condition. if < 3 then run 1 iteration only else 5 iteration so I implimented this as follows

val rnd: Random = new Random()
val RndVal = rnd.nextInt(5)

.doIfOrElse( RndVal < 3 )
{
exec(http(“Page ${Para_Ids(0)}”)
.get("/computers?p=${Para_Ids(0)}"))
.pause(1)
}{
repeat(5, “n”) { // 1
exec(http(“Page ${Para_Ids(${n})}”)
.get("/computers?p=${Para_Ids(${n})}")) // 2
.pause(1)
}
}

but this is throwing Failed to parse ERROR

any idea what’s wrong here?