Hi,
I have requirement to pass the main forEach index in second sub forEach.
like i highlighted fv!index from main loop and that highlighted fv!index want in second sub loop in the place of highlighted ri!SID_QuesIndex_RI text.
so how can i do this.
contents: { a!forEach( items: local!items, expression: { a!textField( label: "Question " & fv!index, value: fv!item.QuestionText, saveInto: { ri!SID_reviewQ_RI[fv!index].QuestionText, a!save(ri!SID_QuesIndex_RI,fv!index) }, labelPosition: "ADJACENT" ),
a!forEach( items: fv!item.RevAnsCDT, expression: { a!textField( label: "Option " & fv!index , value: fv!item.AnsText, saveInto: ri!SID_reviewQ_RI.RevAnsCDT[fv!index].AnsText, align: "LEFT", labelPosition: "ADJACENT" ), a!integerField( label: "Weightage " & fv!index, value: fv!item.Weightage, saveInto: ri!SID_reviewQ_RI[ri!SID_QuesIndex_RI].RevAnsCDT[fv!index].Weightage, align: "LEFT", labelPosition: "ADJACENT" ) } ) } ) }
Discussion posts and replies are publicly visible
You can save the index value in local variable, see an example below
a!foreach( items : {1,2,3}, expression : with( local!mainIndex : fv!index, a!foreach( items : {5,6,7}, expression : local!mainIndex ) ) )
Thanks