I verified that I was using the method as highlighted in the screenshot and when I download a File Geodatabase it downloads all the images from all records.
My method is to make sure that the “Selected records only” is selected, that only one record is selected, and then I click download “File Geodatabase”. Then I run the ArcMap script to get photos and it pulls all the photos for all records.
So, when you add the feature class from the exported file geodatabase to ArcMap, records other than those that were selected are present? Which ArcMap script are you referring too?
The script that I am currently using is the one recommended by survey123, the arcpy code is below. When I use ArcMap to pull the images from the geodatabase then I still pull all the images from all the records and not just the one selected originally.
from arcpy import da
inTable = arcpy.GetParameterAsText(0)
fileLocation = arcpy.GetParameterAsText(1)
with da.SearchCursor(inTable, ) as cursor:
for item in cursor:
attachment = item
filenum = "ATT" + str(item) + "_"
filename = filenum + str(item)
open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes())
Thank you for clarifying, Chris.
As it turns out, the selection of records on the parent layer in the Survey123 website does not currently correspond to the the related table storing the attachments. This is why the exported related table contains all attachments within the related table.
We do have an open issue for this functionality and we are looking to include it in a future release of the Survey123 website. I have added your comments to the issue and will update you when this changes.