Survey 123 hyperlink to local file

4736
15
Jump to solution
01-04-2017 08:45 AM
BrentKinal1
Occasional Contributor III

I have created some help documentation for my survey 123 application and would like the user to be able to open the file via a  hyperlink displayed as a note in my form. My goal is to save a HTML page in the Media folder and have it upload with the form, which it does, however I can't seem to figure out the proper syntax for opening a file stored in the media folder using a relative path. I have tried the following:

<a href="file///.media/help.htm">Help</a>

<a href="media/help.htm">Help</a>

And while I am at it...is there a way to keep the "Help" hyperlink note at the top of the page and keep it from scrolling with the rest of the questions on the page?

Thanks,

Brent

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DeonLengton
Esri Contributor

Hi Brent

Incidentally I had a similar requirement to display a PDF file after the user clicks on a link in the Survey

I have managed to solve this by putting an HTML link to the file in the survey:

concat('<a href="file:///storage/emulated/0/ArcGIS/My Surveys/549c05bae0f14e388000486ce4de950c/esriinfo/media/help.pdf" class="link external button button-raised button-fill color-blue">Demo</a>')

I am sure the class="link ....." can be simplified but it works the way it is at least :)

You will notice that 549c....950c refers to the item ID of the survey - so you will only be able to use that after you've at least published your survey once. Thereafter you can finalise your href links and it works pretty well - on Android at least... i suspect that if you venture to iOS devices the URL will be different but you can identify the OS by using "property('uri:deviceid')" function in a calculation column.

I will add this to my blog as well: https://community.esri.com/groups/survey123/blog/2018/06/08/html-links-for-survey123-to-just-about-a... 

Regards

View solution in original post

15 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Brent,

There are a couple of issues with displaying an instructions page as you describe it- Survey123 isn't an application that internally uses hyperlinks like a web browser (it supports some HTML formatting but isn't HTML itself) and application sandboxing would make it a bit difficult to view the HTML document in a web browser or other application.

That being said, a couple of other ideas for providing access to instructions:

  • (Online only) – Create an instruction manual as .doc/.pdf and place it online. Have a hyperlink in a note that links to the document
  • Embed the instructions in the surveys as notes; use a select_multiple question as ‘Show Instructions’ (with a 1-value choice list) and have the instruction notes be relevant on whether the ‘Show Instructions’ question is checked.
BrentKinal1
Occasional Contributor III

Hi James,  Thanks for your response, It wasn't exactly what I was hoping for but I do understand from a security stand point the limitations of application sandbox. The second of the two solutions you proposed will most likely be the best option since my survey will be used outside of internet connectivity and often on non-networked devices. Perhaps down the road Esri can build a more robust option for users to build customized help menu within the application sandbox like link to a html or pdf file with a specific name stored in a specific location or something more internal with the Survey 123 code...

Do you know if there is a way to have the note and the select multiple question persist at the top or bottom of the form and not scroll with the rest of the questions so that the "help" menu can be easily accessible at any point in the survey? I am guessing probably not.

Thanks again for your help!

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Brent,

There isn't a way to have a question 'float' at the top or bottom of the survey.

I've logged the idea of a user-supplied help file as a possible enhancement- you might want to go to the ideas.arcgis.com website and log it in there, so other people can provide comments/upvote it (it helps gauge the audience for an enhancement).

DeonLengton
Esri Contributor

Hi Brent

Incidentally I had a similar requirement to display a PDF file after the user clicks on a link in the Survey

I have managed to solve this by putting an HTML link to the file in the survey:

concat('<a href="file:///storage/emulated/0/ArcGIS/My Surveys/549c05bae0f14e388000486ce4de950c/esriinfo/media/help.pdf" class="link external button button-raised button-fill color-blue">Demo</a>')

I am sure the class="link ....." can be simplified but it works the way it is at least :)

You will notice that 549c....950c refers to the item ID of the survey - so you will only be able to use that after you've at least published your survey once. Thereafter you can finalise your href links and it works pretty well - on Android at least... i suspect that if you venture to iOS devices the URL will be different but you can identify the OS by using "property('uri:deviceid')" function in a calculation column.

I will add this to my blog as well: https://community.esri.com/groups/survey123/blog/2018/06/08/html-links-for-survey123-to-just-about-a... 

Regards

MikailaBell
New Contributor III

Hi Deon,

I am trying to get this working on iPad.

Did you (or anyone else) ever get this working on an apple device?  I would be very grateful to know how, and if it's possible.

Best regards,

Mikaila

0 Kudos
DeonLengton
Esri Contributor

Unfortunately not yet

0 Kudos
MikailaBell
New Contributor III

Thanks for the update, and again for your wonderful write-up on hyperlinks. It's very helpful stuff.

Please update if you work it out. 

0 Kudos
Hussam_AlJabri
Occasional Contributor III

Hi Deno,

Thanks for your this comment.

I'm wondering if you can support me by having a hyperlink to be access from the Survey123 Website. We downloaded all the attachments in local shared folders and we want a supervisors to see the photos of the inspected assets in the shared folders instead of web map pop-ups because the attachments of the related table are not appears in the Preview windows as long we're using ArcGIS Enterprise 10.6.1.

best regards, 

0 Kudos
DeonLengton
Esri Contributor

The best way would be to use the concat function to build up a URL to the photo locations and then use note fields to show the hyperlinks to these URLs

0 Kudos