Generate Qr code ||| Generar codigo QR

3805
10
Jump to solution
04-01-2022 02:42 AM
JavierCMartínezPrieto
Occasional Contributor

Good morning everyone

I would like to know if there is a way to generate Qr code through a survey form field.

Greetings to all!

########################ESPAÑOL#####################################

 

Buenas a todos

me gustaría saber si hay alguna forma de generar código Qr a través de un campo del formulario de survey.

Saludos a todos!!!

Javier C. Martinez Prieto
Tags (3)
0 Kudos
3 Solutions

Accepted Solutions
Gerhard
New Contributor III

Hola @JavierCMartínezPrieto,

I don't believe Survey123 natively holds this capability. You could try using an API like https://goqr.me/api/ to generate a QR code, then pull the image into your form. There may be a more elegant way to do this but I simply concatenated text from an input (easily customised to your requirements) to create a url for the API. I then just added an image tag to query the API and show the resulting image. Please see attached. I've only tested this in Connect but hopefully gives you a starting point!

Screen Shot 2022-04-03 at 17.22.44.png

 

 

Screen Shot 2022-04-03 at 17.21.47.png

 

 

 

 

 

 

 

 

 

 

 

Best,

Gerhard

View solution in original post

Gerhard
New Contributor III

Hi @JavierCMartínezPrieto,

You'll just need to create the API URL again in the report template. You can use an expression like this:

${$image | src:"https://api.qrserver.com/v1/create-qr-code/?size=150x150&data="+input}

This is documented here: Report templates – ArcGIS Survey123 | Documentation

Strings can be concatenated in an expression by joining them with a plus sign. This expression uses this concatenation to pass the contents of a question called field_0 to a QR code-generating service, creating a QR code for the question's response.

${$image | src:"https://barcode.tec-it.com/barcode.ashx?code=QRCode&data="+field_0}

Best,

Gerhard

View solution in original post

Gerhard
New Contributor III

Hi @JavierCMartínezPrieto,

A similar question has been answered here Solved: Barcode/ QR code to populate field in Survey123 - Esri Community and there's a related blog post here Understanding Barcode Questions in ArcGIS Survey12... - Esri Community.

Another way you could go about this is using Survey123 Tricks of the Trade: Web form URL parame... - Esri Community  and creating a QR code from the custom URL. There's an article about this here https://support.esri.com/en/technical-article/000017982.

There's also a sample form in Survey123 Connect I suggest taking a look at. You'll find it in the desktop app by going to ArcGISSurvey123Connect > New survey > Samples > Barcodes.

Hopefully that isn't too many links to check out. Good luck!

Best,

Gerhard

View solution in original post

10 Replies
Gerhard
New Contributor III

Hola @JavierCMartínezPrieto,

I don't believe Survey123 natively holds this capability. You could try using an API like https://goqr.me/api/ to generate a QR code, then pull the image into your form. There may be a more elegant way to do this but I simply concatenated text from an input (easily customised to your requirements) to create a url for the API. I then just added an image tag to query the API and show the resulting image. Please see attached. I've only tested this in Connect but hopefully gives you a starting point!

Screen Shot 2022-04-03 at 17.22.44.png

 

 

Screen Shot 2022-04-03 at 17.21.47.png

 

 

 

 

 

 

 

 

 

 

 

Best,

Gerhard
JavierCMartínezPrieto
Occasional Contributor

thank you very much for your reply, I will try the method you propose.

Best regards Javier

Javier C. Martinez Prieto
JavierCMartínezPrieto
Occasional Contributor

Good morning, @Gerhard 

It works perfectly and generates the Qr code in the survey, but how do I get that Qr code in the reports.
Since I do not see the image but the url.

Greetings

Javier C. Martinez Prieto
Gerhard
New Contributor III

Hi @JavierCMartínezPrieto,

You'll just need to create the API URL again in the report template. You can use an expression like this:

${$image | src:"https://api.qrserver.com/v1/create-qr-code/?size=150x150&data="+input}

This is documented here: Report templates – ArcGIS Survey123 | Documentation

Strings can be concatenated in an expression by joining them with a plus sign. This expression uses this concatenation to pass the contents of a question called field_0 to a QR code-generating service, creating a QR code for the question's response.

${$image | src:"https://barcode.tec-it.com/barcode.ashx?code=QRCode&data="+field_0}

Best,

Gerhard
JavierCMartínezPrieto
Occasional Contributor

Good morning @Gerhard 

Thank you very much it works perfectly.

Regards javier

Javier C. Martinez Prieto
JavierCMartínezPrieto
Occasional Contributor

Good afternoon @Gerhard 
everything you have proposed has worked perfectly, my question now would be:
Is it possible to do the reverse operation, i.e. if you have a QR code you can fill in a survey questionnaire with the information in the QR code.

Thanks in advance.

Best regards Javier

Javier C. Martinez Prieto
Gerhard
New Contributor III

Hi @JavierCMartínezPrieto,

A similar question has been answered here Solved: Barcode/ QR code to populate field in Survey123 - Esri Community and there's a related blog post here Understanding Barcode Questions in ArcGIS Survey12... - Esri Community.

Another way you could go about this is using Survey123 Tricks of the Trade: Web form URL parame... - Esri Community  and creating a QR code from the custom URL. There's an article about this here https://support.esri.com/en/technical-article/000017982.

There's also a sample form in Survey123 Connect I suggest taking a look at. You'll find it in the desktop app by going to ArcGISSurvey123Connect > New survey > Samples > Barcodes.

Hopefully that isn't too many links to check out. Good luck!

Best,

Gerhard
JavierCMartínezPrieto
Occasional Contributor

Good afternoon @Gerhard 


thank you very much, I will try it this week

Regards

Javier C. Martinez Prieto
0 Kudos
JavierCMartínezPrieto
Occasional Contributor

Good morning @Gerhard!!!

is there any way that the image generated in the Qr survey can be inserted as an attachment in the survey.

I have tried to create an image and row type field using the default column and calculation but it does not save automatically.

thanks for your time

Regards javier.

 

 

Javier C. Martinez Prieto
0 Kudos