Select to view content in your preferred language

Report Template: positions of nested repeats

126
6
Tuesday
danbecker
Frequent Contributor

I have a nested repeat of noncompliance and noncompliance_photos.

${#noncompliance}

$#{noncompliance_photos}

${/}

${/}

 

In a feature report template, how do I use the $feature keywork to get the position of each record? 

${#noncompliance}${if (noncompliance_photos | getValue:"count")>0}

Non-compliance Number: ${$feature | getValue: "position"}

Photo Number: ${$feature | getValue: "position"}

${/}${/}

 

The above only gets the position of the inner-most repeat, not the parent repeat. 

Any help with this? 

0 Kudos
6 Replies
Neal_t_k
Frequent Contributor

Did you try like this?  The non compliance number is is in the parent repeat, and in the above you are calling in the child/photo repeat.

${#noncompliance}

Non-compliance Number: ${$feature | getValue: "position"}

${if (noncompliance_photos | getValue:"count")>0}

Photo Number: ${$feature | getValue: "position"}

${/}${/}

0 Kudos
danbecker
Frequent Contributor

I have this at the top, so that the entire section can be skipped if no photos exist.

${#noncompliance}${if (noncompliance_photos | getValue:"count")>0}

 

But I guess, that starts the noncompliance_photos parser?

0 Kudos
Neal_t_k
Frequent Contributor

In that case, not sure if this will work or not:

${#noncompliance}${if (noncompliance_photos | getValue:"count")>0}

${#noncompliance}

Non-compliance Number: ${$feature | getValue: "position"}

${/}

Photo Number: ${$feature | getValue: "position"}

${/}${/}

0 Kudos
danbecker
Frequent Contributor

unfortunately, that doesn't work. It then thinks both #noncompliance and #noncompliance_photos are unclosed.

0 Kudos
Neal_t_k
Frequent Contributor

Could you put a counter in your parent repeat to count the number of photos in the child repeat. Then something like this:

${#noncompliance}${if countphoto>0}

Non-compliance Number: ${$feature | getValue: "position"} 

${if (noncompliance_photos | getValue:"count")>0}

Photo Number: ${$feature | getValue: "position"}

${/}${/}${/}

Neal_t_k_0-1761750106524.png

 

0 Kudos
danbecker
Frequent Contributor

I ended up putting a counter on the parent repeat. 

0 Kudos