Hello Marlene,
If your selector photo_type exists outside the Repeat that holds the photos this is part of your problem as you are trying to evaluate it from within the Repeat and it doesn't exist there. Now I'm making an assumption that this is the structure of your XLSM Form since it's not provided here but I have just solved this for myself on a project and it works perfectly.
So in short if your Dropdown for selecting photo_type=="overall" is in the repeat where the photos are capture then the following will work...
${#photoRepeat}
${if photo_type == “overall”}
${photo | size:450:350}
${/}
${/photoRepeat}
${photo | size:466.9:350} this is based on ${image1|size:width:height:max_width:max_height} not sure why you have a decimal in there 466.9 not recommended for sizing of photos.
In my Survey123 Application, I have a Page with a Repeat field in an App which allows our Troopers to selected and Add multiple Evidence Items with details and photos of the items. Inside the Repeat they select the Evidence Type and the fill-in the details and take a photo of the item. They can repeat this data collection routine over and over first starting each by selecting the Evidence Item Type' Drug, Weapon, Currency, etc.
After this is done all the Evidence entries end up in a related table including the photos. From here I can call the photos in my Word Template based on the evidType=="" as shown here...
I can also control the pagination and the ability to keep all of the information grouped together as I have a section for Subjects that is handled similarly that also has to determine if the Subject is the Person of Interest, a Passenger, a Witness, or Other...
Here's a snapshot of part of my Word Template that Sruvey123 uses to generate the Printable Output...
${#Item} ${if evidType == “WEAPON”}
EVIDENCE ITEM: ${evidType} |
Weapon Type: ${weaponType} | Weapon Serial Number: ${weaponSerialNumber} | Blade Length in Inches: ${weaponBladeLength} | ${evidPhotos | size:115:0} |
Make: ${weaponMake} | Model: ${weaponModel} | Caliber: ${weaponCaliber} |
Describe the Weapon: ${weaponOther} |
Evidence Delivered By: ${evidStorageBy} | Evidence Initially Stored At: ${evidStorageLocation} ${sheriffOffice} |
| | | | |
${/} ${/Item}
${#Item} ${if evidType == “CURRENCY”}
EVIDENCE ITEM: ${evidType} |
Currency Type: ${currencyTypes} | Amount in US Dollars: ${currencyAmount} | ${currenyBatchReport | size:115:0} | ${evidPhotos | size:115:0} |
Type of Currency: ${currencyType} | Counting Method: ${currencyCountMethod} |
Evidence Delivered By: ${evidStorageBy} | Evidence Initially Stored At: ${evidStorageLocation} ${sheriffOffice} |
${/} ${/Item}
Rinse and Repeat as necessary...
Here's what this part of my App looks like in Survey123... You'll notice that the Dropdown that determines the Type of Evidence Item is within the Repeat...
If you have any further questions on this please don't hesitate to reach out to me and I'll try and assist you as time permits. I'm also available for outside consulting if needed and I've provided both of my email contacts below.
Sincerely,
Chris Rogers
Christopher.rogers@dps.ok.gov
chris@qleapgis.com