As a general rule, you can only access the value of fields that are within the relevant row of a repeat.
For example, if you have Repeat1_rpt that contains Field1_txt, when you assemble the template, the value of Field1_txt gets inserted in each row of the Repeat1_rpt.
We have two field prefixes which allow you to access field values from adjacent rows of the repeat.
'Next.'
You can access the next value of Field1_txt in a Repeat1_rpt row by using the Next. function. You add the Next. to the beginning of the field that you are accessing.
For example, Next.Field1_txt would return the value of Field1_txt for the row of Repeat1_rpt below the one currently being assembled.
You can also use the Next.Field1_txt value in a conditional IF statement, e.g. { MERGEFIELD IfStart:A ([Next.Field1_txt] <> '') } would return true if the next value of Field1_txt was not blank - that is, if there was some text within the field.
'Previous.'
In much the same way as with Next., you can access the previous value of Field1_txt in a Repeat1_rpt row by using the Previous. function. You add the Previous. to the beginning of the field that you are accessing.
For example, Previous.Field1_txt would return the value of Field1_txt for the row of Repeat1_rpt above the one currently being assembled.
You can also use the Previous.Field1_txt value in a conditional IF statement, e.g. { MERGEFIELD IfStart:B ([Previous.Field1_txt] <> '') } would return true if the previous value of Field1_txt was not blank - that is, if there was some text within the field.
Comments
0 comments
Article is closed for comments.