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?
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"}
${/}${/}
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?
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"}
${/}${/}
unfortunately, that doesn't work. It then thinks both #noncompliance and #noncompliance_photos are unclosed.
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"}
${/}${/}${/}
I ended up putting a counter on the parent repeat.