I have a feature report going complete with if statements.
I wanted to hide questions (i.e., the label for a certain field in the form) when the user didn't select any options in the field or fill out the field at all, so the if statements for questions read, "${if fieldname}Field Label${/}".
I also wanted to hide repeat headings (i.e., the name of a repeat section in the form) when the repeat has nothing in it, so the if statement for those repeat sections read, "${if repeatname}Repeat Label${/}".
Is there a way to do the same for a non-repeat group? If I do "${if groupname}Group Label${/}" and try to load the report template to AGOL, I get an error that reads, "An error occurred when checking the report template. Failed to parse ${if groupname} since groupname cannot be found in the current parsing scope." (I should probably mention that it doesn't seem to matter if the group I do this for is within or outside a repeat section -- I get the same error.)
Hi @aytlDEC ,
Thanks for sharing here. Instead of using ${if groupname}, I think you could use ${if fieldname1InGroup || fieldname2InGroup || ...}Group Label${/}. Then, the Group Label appears when there is at least one question that contains a value.
Thanks,
Ruth
That would work if there were only a handful of questions -- if a group had a lot of questions, I take it there isn't a simpler way?
By the way, since I posted this yesterday, I came across another post that implies that this is some sort of error (https://community.esri.com/t5/arcgis-survey123-questions/survey-123-report-template-error-failed-to-...). It seems like this has yet to be fixed then -- it doesn't really make sense for ${if ____} works for repeats and fields, but not groups.