Select to view content in your preferred language

Renaming images in bind::esri:parameters not working (web app)

2691
11
Jump to solution
10-04-2022 08:46 AM
frfu794d
New Contributor

Hello Everyone,

I use the survey123 web app for Vistitor employed photography with cellphones (participats are not logged in). I have the problem that many images have the same name, namely "image.jpg". I would like to rename the images during the participation according to an ID created for each participant and the question answered. There are options to do this, but they seem not to work for me.

I have created an hidden ID field for each participant with uuid() and would like to rename all images of the participant with this ID and the question name in the field bind::esri:parameters with fileName=concat( "ImageQuestionNumberOne",${id}). But this does not work. Depending on the Phone used by the participant, I get image names consisting of a random number, a number with the date or images with the name image.jpg.  I have the same Problem if i only use a string or other ID's to rename it.  Does anyone know what I am doing wrong? An example is added.

Thanks a lot!

1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Hi @frfu794d  The XLSForm you provided works perfectly. I published your survey and tested from a web browser. Photos are renamed according to the expression you set

May be you are not using the latest version of Survey123 Connect to publish your survey? Make sure it is 3.15 or newer.

View solution in original post

11 Replies
LaurenceTait
Frequent Contributor

If you are getting random numbers, a number with the date or images with the name image.jpg, that means the calculated name isn't resolving to anything meaningful, and the devices are defaulting to standard naming

I just tried the xlsx sheet on two different Android devices, it works as expected:

LaurenceTait_0-1664936253779.png

LaurenceTait_1-1664936334420.png

 

What devices are you having problems on?

One thing could to try is changing the name field in row 4 to "image_name". While "name" is not strictly reserved, using parameter names for field names is a good way to get weird glitches.

0 Kudos
IsmaelChivite
Esri Notable Contributor

Hi @frfu794d  The XLSForm you provided works perfectly. I published your survey and tested from a web browser. Photos are renamed according to the expression you set

May be you are not using the latest version of Survey123 Connect to publish your survey? Make sure it is 3.15 or newer.

LMedeirosUI
Frequent Contributor

I had this working in 3.13 (in November 2022) and it stopped working (as of 3/15/23, though I haven't tried to use it since then). Why would the update cause this to not work in a previously existing survey? I have a mac and really do not want to have to run parallels just so I can update Connect to get a previously working survey to work again.

0 Kudos
Tiff
by
Frequent Contributor

Hello, I am also having an issue with image file names when accessing the survey through a web or mobile browser. The file names show up as intended in the Survey123 field app and in the Survey123 Connect preview, but will have varying results ("image1.jpg", a series of numbers, etc.) on the mobile browser depending on whether the photo is from the camera or existing library.

Is this a documented issue or am I doing something wrong? Since this survey requires editing existing records and submitting repeats we are limited in options in where data can be submitted.

0 Kudos
LMedeirosUI
Frequent Contributor

@Tiff  There's a setting in the web app to make the survey use a particular version of the web app (i.e., the one it was published with or the most current version). It's accessed by going to survey123.arcgis.com, going to the survey, then accessing the survey's settings (far right option in header - see attached picture). What is yours set to?

And as a follow-up after reading some of your other posts, make sure you're using the latest version of Connect to publish the survey. I had published with an older version because I'm on a mac (3.13) and that "broke" the file name feature. When I republished using the current version (3.17), it worked again. I didn't change anything in the XLS form... it just matters what version of Connect you're using to publish the form. This means that it will work in Connect when testing, but won't work when you publish. If you're using a PC, just update Connect and republish. If using a mac, you'll need to use Parallels or find a PC as Esri no longer publishes updates for the Connect app for mac. You will also have to be using current versions of the field app and make sure the setting I mention above (for the web app) uses the latest version.

0 Kudos
Tiff
by
Frequent Contributor

Hi @LMedeirosUI  thanks again for your response! I do have "Use the version the survey was published with" due to the warning stated about bugs. However, you may be right! I didn't think versioning would be an issue because I just published the survey last week but I'm seeing there was an update just yesterday.

Once this setting is toggled in the Survey123 website, do you know if that is maintained for the survey altogether? I guess my question is do you know if it is reversible? Could I for example check the "Always use the latest version" and then go back and choose to have the same version that my survey currently is published with? 

0 Kudos
LMedeirosUI
Frequent Contributor

@Tiff  What version of Connect are you using? If you just published it and are using an up to date version of Connect then the issue is something else. If the version listed in the web app is 3.17 then you're up to date and it isn't the issue. 

To answer you question, though, I don't know. I would imagine you would be able to toggle it on, have it update to the latest version (again, assuming it isn't 3.17), see how it goes, then toggle it off and republish it from Connect (which would still have your "current" version).

0 Kudos
LMedeirosUI
Frequent Contributor

@Tiff I found your post where you said what your cell looks like. the format_date function should be changed to format-date.

Updated cell: fileName=concat(${ID_num}, "-", format-date(now(),"%Y%m%d"), "-", format-date(now(), "%H%M%S")) fileNameVisible=true allowRename=false

0 Kudos
Tiff
by
Frequent Contributor

Hi @LMedeirosUI darn, I was hopeful that would be it because I didn't even catch the format_date discrepancy. However, I'm still seeing the same results in the mobile browser unfortunately. Also, somehow format_date did work when testing it in Survey123 Connect. So perhaps the version is the issue...

0 Kudos