Conditional repeats in Feature report template

255
1
09-07-2020 07:31 PM
ReubenWilliams
New Contributor

Hi I'm trying to create a feature report where I only include a section if there is data to show. Is there an if statement that will check for any data at all within a repeat?

I have a repeat field for images and I'd like to know if I can exclude the section if no photos have been taken.

I expect the syntax to be somethiong like the following, but so far I can't get it right.

${if #images}
   Section Header
   ${#images}
      ${imageA}
      ${imageB}
   ${/images}
${/}

Thanks in advance.
0 Kudos
1 Reply
ZacharySutherby
Esri Regular Contributor

Hello Reuben Williams‌, 

I apologize for the delay in reaching out! Please try the following syntax: 

${if (images| getValue:"count")>0}Section Header${/}

${#images}

${photos | size:460:0}

${/}

We have an issue logged on our end where this will not work in the current production ArcGIS Survey123 Website, but the fix has been implemented in our Beta 3.11 website. Please test in https://survey123beta.arcgis.com as that should work. 

Thank you, 

Zach

Thank you,
Zach
0 Kudos