Skip to main content
New Participant
Oct 2, 2025 2:06 PM UTC

GIS hyperlinks setting using both "Primary Image Field" and "Default Image Directory"

Hi,

 

I am using "Primary Image Field" and "Default Image Directory" under the Asset Field Configuration to set up the service ID information hyperlink.

"image"After I am done, the url likes the one below if the SERVICEID is "S0001".

 

https://gis-web.ca/appname/view?tabIndex=0&serviceid =/S0001

 

But the correct url should be:

 

https://gis-web.ca/appname/view?tabIndex=0&serviceid =S0001

 

Cityworks automatically added a "/" when it concatenated both "Primary Image Field" and "Default Image Directory" together. Do you know if there is a way that is able to remove this "/"?

 

Thanks,

Saili

    3 replies

    Known Participant
    Oct 2, 2025 4:09 PM UTC

    @saili tang? That's because that configuration option is meant for files, not URLs. You need to use the File Path option instead and store the full URL

     

    https://cityworks.my.site.com/s/article/12694-INFORMATION-GIS-Hyperlinks

     

    INFORMATION

     

    GIS hyperlinks can be enabled in Cityworks in Admin or Designer—by setting the File Path = Y under the Asset Form Configuration section, or by setting a Primary Image Field and Default Image Directory under the Asset Field Configuration.

     

    If you are using URL-based hyperlinks or file-based hyperlinks storing the full path and file name, then the File Path option must be used. However, if using file-based hyperlinks where only the file is referenced in the GIS attribute field and the path to it in Cityworks, then the Primary Display Field and Default Image Field must be used.

    Translate
    New Participant
    Oct 2, 2025 4:09 PM UTC

    Hi Steven,

     

    Thank you so much for your reply. Understood that. I also read the Cityworks document, too. So, what you meant is that the idea I posted is not possible, right? Is there anywhere in Cityworks I can add some customized code to realize it?

     

    Thanks,

    Saili

    Translate
    Known Participant
    Oct 2, 2025 4:09 PM UTC

    Hi Steven,

     

    Thank you so much for your reply. Understood that. I also read the Cityworks document, too. So, what you meant is that the idea I posted is not possible, right? Is there anywhere in Cityworks I can add some customized code to realize it?

     

    Thanks,

    Saili

    @saili tang?  Since the Primary Image Field and Default Image Directory are meant for file-based hyperlinks, the only way I could see your example working is if you did this

     

    Default File Path = https://gis-web.ca/appname

    Primate Image Field = view?tabIndex=0&serviceid=S0001

     

    By doing it that way, the / in your example, which gets added with the concatenation, should be in the correct spot. However, I'm pretty sure it should be injecting a backslash () for a UNC path, not a forward slash (/) for a URL like you showed, since that's meant for file-based links.

     

    Otherwise, you would need to switch to the File Path option and write the entire URL to the GIS attribute field https://gis-web.ca/appname/view?tabIndex=0&serviceid=S0001, or possibly handle things directly in the GIS outside of Cityworks with the REST service APIs.

    Translate