Extending Survey123 smart forms JS functions image parameter

11-26-2021 06:30 AM
New Contributor


I want to use the javascript extension to send an image to an external API for analysis. when I try to send the image as a parameter with the pulldata (ex: pulldata ("@ javascript", "myFunctions.js" ", $ {image}), I get the name of the image on the javascript side.

Do you have a solution for me to transmit the complete image (encoded 32 or 64) on the javascript side?

Thank you

0 Kudos
1 Reply
Esri Notable Contributor

Hi. It is not possible to pass the encoded image into a custom JS function. Additionally, it will be very difficult for you to control when exactly your JS function executes, causing multiple uploads of your image to your service.  

As alternatives:

  • You could create a custom add-in for the field app.
  • You could use workflow automation (Integromat or Power Automate) to process the image once the survey is sent
0 Kudos