Select to view content in your preferred language

Add a weblink to a form based on a field in a feature service

1691
8
08-13-2018 11:28 AM
by Anonymous User
Not applicable

I have a form that is driven by a feature service.  In the feature service I have a field that has a unique URL for each record.   I have created a survey form using this feature-service and would like to add the unique url to the form as a web link.   I can get the URL to show in the survey form with out adding any syntax label field but the URL it is not clickable?    The form field is called GMAP_HYPERLINK. 

I can get the form to present a weblink when I add this from example from the types tab .   

<a href="http://www.esri.com">Link to esri web site</a>   I get a link in the form that takes me to esri.com.  

Here is the syntax I tried to generate a link from the pre-calculated field GMAP_HYPERLINK.

<a href="{GMAP_HYPERLINK}">

 this is what I get in the form (See Attached)

I am sure I am missing something in the syntax but I can't seem to figure it out.  

Any help would be greatly appreciated!!

Tags (1)
0 Kudos
8 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Robert,

Just to check, but does the link text follow a full HTML tag pattern?

<a href="[link]">Click here to open</a>

It currently looks like you only have the first part.

0 Kudos
by Anonymous User
Not applicable

Yes, I believe the URL's saved in the feature service "GMAPS_HYPERLNK" field are complete URLs.   

Here is an example: Google Maps 

This URL can be pasted directly into a browser and it will take you to the location in Google Maps

At this point with the  <a href="[GMAPS_HYPERLNK]">Click here to open</a>

This is what I get in the form.  

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Robert,

Any chance you can share the full value of the note in the XLSfile?  That would help debug. Alternatively, here's a sample that does work.

0 Kudos
by Anonymous User
Not applicable

Not sure what you are asking for?  the entire .XLS file or just the row of the note?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

The row of the note should be sufficient, though the entire XLS file would definitely help.

0 Kudos
by Anonymous User
Not applicable

Here is the top of the form I have with the note field.    I reconfigured the syntax based on your sample.

Thanks!

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Robert,

Can you try

concat('<a href="',${GMAPS_HYPERLNK},'">Click here to open</a>')

- text portions must be encapsulated with either single or double quotes (' or ").  When doing HTML, I tend to use ' for this as HTML uses quoted attributes extensively, which I use " for

- field values should be separated from text portions and is referenced by ${question}, per XLSforms

0 Kudos
by Anonymous User
Not applicable

Thanks James That worked!!!

0 Kudos