Select to view content in your preferred language

how to make a hyperlink to a relative .txt file within arcgis pro attribute table

1122
2
09-22-2021 07:31 AM
PaulKennedy1
Occasional Contributor

using arcgispro, witihin a field of a row in a featureclass I am trying to define a hyperlink to a text file which is relative to my project home folder.  

it is my understanding we can define a hyperlink to an absolute file (whihc I can confirm works just fine, the file operns in notepad)...

<a href="file:///c:\temp\readme.txt" >tidedata results</a>

 

however, the c:\ is not portable so is generally a really bad idea.  a better approach is a relative path

 

I have tried many variants but cannot seem to get this to work in arcgispro...

<a href="file:///.\docs\readme.txt" >tidedata results</a>

<a href="file://.\docs\readme.txt" >tidedata results</a>

<a href=".\docs\readme.txt" >tidedata results</a>

<a href="readme.txt" >tidedata results</a>

I thought the external files would be relative to teh aprx file, ie in the project home folder

for the life of me I cannot get this to work.  would anyone have a clue how to make this work?

regards

 

 

0 Kudos
2 Replies
RobertBorchert
Honored Contributor

I believe you are correct in the relative path part.  I believe you need absolute path.

 

forward slants instead of back slants.  here is an example of a hyperlink I have that opens a specific page in a specific pdf based on the file name field.

'file:///C:/MapBook/myfile.pdf#page=' + $feature.FILENAME

I will not work without a proper directory structure. 

it will not know where   .\docs is

In my example you will see C:/Mapbook which is a specific folder location.  I do not think it can work with relative path names

You mention portable. A remote computer would not be able to find the C: drive on someone else's computer without using a UNC path. 

You many need to load the file into your Portal or AGOL and use https to get to it.  We do that with our a number of our assets that will link direct to their Maximo data

0 Kudos
PaulKennedy1
Occasional Contributor

thanks for getting back to me.  relative URL works fine in ArcMap if we query a feature.  unfortunately this is broken in arcgispro.  such a pity, but only to be expected with arcgispro.  for the life of me I do not know how pro got out the door as a product.

the solution is to use arcmap or qgis.

0 Kudos