AnsweredAssumed Answered

Selectively put Photos from Repeat in Report

Question asked by deleted-user-cOp1WVV-PBwI on Jun 19, 2019
Latest reply on Sep 29, 2019 by j.moore-esristaff



I'm looking to filter photos taken in the field and selectively put some of them into a report. Right now, photos are acquired in a repeat, and a select_one question also in the repeat has the user select from a few different types (overall, problem, and extra). See the photo below for a look at what's going on in excel. I've filled out a fake survey with three pictures that are "labeled" with the select_one question, one for each category in the same order as listed. In the report template at the moment, I'm trying to get just the photo that was labeled "overall" to show up. Code is as below:



${if ((photo_type) == “overall”)}





No errors, but no matter what category the if statement is looking for it will print out all three photos. When it first printed all three, it was looking for the "overall" category, which was with the first picture. I tried changing the category to "extra" (the last picture) but still got all three photos, so it almost seems to me like the "${photo|size:466.9:350}" line is just spitting all three photos out. I'd love some thoughts on whether this endeavor is possible / where I'm going wrong if it is. 




Marlene McGraw


EDIT: I'm going to put the solution here just so it's all clear if anyone needs to reference this in the future; for checking these values, you actually need to see if it matches the label name, not the data field name. In this case, my data field name was "overall" vs my label "Overall", so the capitalized version worked. Jim Moore also made a great point that my syntax here is wrong too - you'd want it to look like so: ${if photo_type == "Overall"}.