Howdy,
I have a survey with 3 image uploads, no repeats are being used. The names used for these in the xlsform are photo1, photo2, photo3. I am using the Survey123 mobile app version 3.15.159 for Android. I would like to build the unique image names from the date/time of the images creation, below are the issues I have encountered: 1) I found that the bind::esri:parameters is not compatible with pulling the date/time from the image file like this:
fileName=concat(${Record_ID} ,"_", format-date(pulldata("@exif",${photo2}, "DateTime"),'%Y%m%d%H%M%S'))
Am I doing something wrong with the above or is this a known issue?
2) As a 2nd best option I tried using now() to give each image a unique ID however I found that now() doesn't refresh between image uploads. Meaning that this formula was not unique between the images uploaded:
fileName=concat(${Record_ID} ,"_",format-date(now(),'%Y%m%d'),"-",format-date(now(),'%H%M%S'),"_",substr(pulldata('@property','userFirstName'), 0,2),pulldata('@property','userLastName'))
3) Since those didn't work out, for the moment I am hardcoding a 1/2/3 into the file name for each photo field to force distinct names:
photo1:
fileName=concat(${Record_ID} ,"_",format-date(now(),'%Y%m%d'),"-",format-date(now(),'%H%M%S'),"-1_",substr(pulldata('@property','userFirstName'), 0,2),pulldata('@property','userLastName'))
photo2:
fileName=concat(${Record_ID} ,"_",format-date(now(),'%Y%m%d'),"-",format-date(now(),'%H%M%S'),"-2_",substr(pulldata('@property','userFirstName'), 0,2),pulldata('@property','userLastName'))
4) To tack on another issue I found, I was not able to retrieve just the first initial of the users first name using this:
substr(pulldata('@property','userFirstName'), 0,1)
So instead I am retrieving the first two letters of the name with this:
substr(pulldata('@property','userFirstName'), 0,2)
Any assistance is appreciated 🙂