How to grab the index # of a list item to create a conditional statement in a Start - End loop

Hi,
Making myself a little nuts over here.
I have created a PDF template that uses a Start-End to loop thru a referenced list.
It works ok.
But the formatting of the pdf is a little lacking. So, I wanted to identify the 3rd item in the list and add an image to that block - this would act as a header for the 2nd page of the pdf. I can control the spacing and I know that the 3rd item will be on the top of the 2nd page.
But I canโ€™t find a way to grab the index # of the 3rd list item in order to add the conditional statement.

Below is the code snippet. Can anyone offer a solution?

"<<If: COUNT([Related Next of Kins Active]) >0>>

<<Start: [Related Next of Kins Active]>>
My Signature
<<[Signature Image]>>

<<[First Name]>> <<[Last Name]>>, <<[Relationship]>> <<[Entry Date]>>
<>

<>
<>
"

Thanks.
Penny

Solved Solved
0 7 1,176
1 ACCEPTED SOLUTION

So, update.

I tried Marcโ€™s suggestion, โ€œSELECT( [Relatedโ€ฆ][key] , [status] = โ€œActiveโ€ )โ€ but it failed to find the key - maybe because the virtual column is calling a slice.

But I did find a solution to the issue in the original solution -
it seems the, โ€œ<<If: [AdditionNextofKinId] = INDEX( [CR#].[Related Next of Kins Active] , 4 )>>โ€ wigs out if there are only 3 items in the list.
It then formats all items in the template as if they are item 4 (and its related spacing/copy).
So, I added a couple of <> statements:
<<If: COUNT([Related Next of Kins Active]) < 4>> then display regular <> / <> layout
And also
<<If: COUNT([Related Next of Kins Active]) > 3>> then use
โ€œ<<Start: [Related Next of Kins Active]>>
<<If: [AdditionNextofKinId] = INDEX( [CR#].[Related Next of Kins Active] , 4 )>>โ€ layout.

This seems to work.

View solution in original post

7 REPLIES 7
Top Labels in this Space