I am working on a survey that uses a multiline appearance for an image question. I am using the count-selected function in another question to count the number of photos from the image question. Everything is working correctly when a new survey is initiated and sent. However, if I edit that survey from the inbox any additional photos added to the image question are not counted from where the count left off from the initial submittal. Instead it resets and starts the count from 0. For example, if I took 2 photos on the initial survey the count-selected question correctly counts 2 photos, but when I edit that survey from the inbox and add additional photos it will start the count over from 0. I've tried the calculationMode=always but that did not work.
Is this expected behavior? Is there a work around for this? @Ismael
Thank you,
Matt Rogers
Hmmm. That would not be my expectation, but I guess I understand why the behavior is like that (and it logically should not be like that). Let me check as this could be a software defect.
@MatthewRogers Good find. I can repro this problem. I will ask Tech Support to create a BUG for this. The count-selected() function does not report the correct number of photos in the mobile app when the record is opened from the inbox. Once we have a BUG number it will be posted here.
@IsmaelChivite Thank you for looking into this and reporting. Looking forward to when it will gain that functionality.
Thanks,
Matt
BUG-000162677 - Count-selected for image question with multiline appearance returns incorrect count when an existing submission is edited in Survey123 field app inbox
@MatthewRogers - BUG-000162677 has been re-opened today since I was able to reproduce in Survey123 Field App version 3.20.69 on an iPhoneX. It was originally closed as a duplicate, but the linked issue wasn't quite the same.
I posted a potential workaround here for different issue, but it should also work for your issue in this thread. Essentially, build a link to open and edit the record in a mobile web browser to view the actual count and/or interact with existing file/image attachments.
to close this loop, BUG-000162677 was closed again internally as a known limitation (and duplicate of another known and now documented issue BUG-000152893) for the following reason from @ZacharySutherby . Thanks for the support and info on this Zach!
This defect was closed as a duplicate of BUG-000152893 because they have the same core issue. Any expressions that reference an image question only use images that are local on the device and not any present in the server.
When a survey is opened via Inbox, the existing images that display aren't downloaded to the device and instead are temporarily downloaded in memory on form load (this is why images in the Inbox don't work offline).
BUG-000152893 is marked as resolved as it was added as a known limitation in the documentation (same with this behavior as well). The steps in both this and the other defect will still yield the same result in the current application.
A JavaScript function would need to be used to query the attachments related to the feature and return the count, then you can add that number with any new images added using the count-selected() function.