Hi,
I was reading this blog post on the December 2021 update and was hoping for some clarification on this bug, which was marked as resolved in the post:
I have a Survey123 form, which I am designing in the latest version of Connect. The URL I am creating works perfectly in Connect when I test, but as soon as the form is published the web form (which I have embedded in a Dashboard) does not work. Please see details below.
I am having some issues with an a href statement working properly. It works perfectly in the field app and Connect (latest version downloaded today). Here is what I see in my form within a Dashboard; the blacked out portion is a read-only URL to SharePoint, while the hyperlink is in a 'note' and should say "View Project Files" and bring the user to the SharePoint location from above:
The URL is completely different than what is specified; it goes here instead: https://survey123.arcgis.com/share/v3.14/
I have tried the a href statement with a : and = after 'target' and get the same result. Here is the XLSForm:
Is this expected behavior? Any advice would be appreciated.
Solved! Go to Solution.
Hi Erica. The mobile and web apps sanitize HTML tags differently. This is why you see your links working in one but not the other. The mobile app is much more strict.
There should be no issues with fixed links. For example, this will work in both the web and mobile apps:
Problems arise when you make your link dynamic. For example, here I am inserting a variable in the link using data from a question in the form. This syntax works in the mobile app, but not in the web app
The trick is to create the complete HTML tag in a calculate question, and then bring that into your note label. For example:
Here is the calculation in plain text for clarity. Putting the quotes of the right type in the right place can be tricky. I typically make the calculate question a text question for debugging, and when it is good to go I turn it into a calculate with esriFieldType set to null.
concat('<a href="https://www.esri.com/',${sublink},'">My link with sublink</a>')
concat('<a href="https://www.esri.com/',${sublink},'" target="_blank">My link with sublink</a>')
Hi Erica. The mobile and web apps sanitize HTML tags differently. This is why you see your links working in one but not the other. The mobile app is much more strict.
There should be no issues with fixed links. For example, this will work in both the web and mobile apps:
Problems arise when you make your link dynamic. For example, here I am inserting a variable in the link using data from a question in the form. This syntax works in the mobile app, but not in the web app
The trick is to create the complete HTML tag in a calculate question, and then bring that into your note label. For example:
Here is the calculation in plain text for clarity. Putting the quotes of the right type in the right place can be tricky. I typically make the calculate question a text question for debugging, and when it is good to go I turn it into a calculate with esriFieldType set to null.
concat('<a href="https://www.esri.com/',${sublink},'">My link with sublink</a>')
concat('<a href="https://www.esri.com/',${sublink},'" target="_blank">My link with sublink</a>')
Thank you for that help - I was not quite doing it this way. I was trying to set up one field for my link (which is type=text, but appearance=calculation and then a concat statement in the calculate column to generate the URL from a base URL and then 3 different fields in the form) and then a note which has the a href in the "label" column. Adding an intermediate calculate question for 'mylink' with your example above worked perfectly.
My quotes were also a bit different from what you've shown, so seeing the second example was very helpful.
I appreciate the help!