Select to view content in your preferred language

WebApp with URL Parameters Not Working in arcg.is Shortener?

302
1
Jump to solution
09-10-2024 02:12 PM
ODWC_GIS
Frequent Contributor

Many see and use the https://arcg.is/ links to access wordy URLs describing some ArcGIS site.

Because of reasons, I wish to store my individual records' URL in a short-ish String field.

They may be created by placing the original, "long URL" after the equals sign below:

https://arcg.is/prod/shorten?longUrl=__________________________________

A .json file will be returned with the shortened URL included.

BUT, it appears that if the long URL contains extra parameters like "extent," they seem to be ignored.

<EDIT>

I found the solution somewhere between the Dev Pages and https://doc.arcgis.com/en/web-appbuilder/latest/manage-apps/app-url-parameters.htm

Your long URL needs to be encoded to be properly accepted in full.

In my case, that meant replacing a few characters with their %xy equivalents:

Encoded_longURL=LongURL.replace("&","%26")
Encoded_longURL=Encoded_longURL.replace("=","%3D")
Encoded_longURL=Encoded_longURL.replace(",","%2C")

I'm happy to report that it's working now!!

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
ODWC_GIS
Frequent Contributor

The solution was to Encode all the URL Parameters associated with the long URL.

View solution in original post

0 Kudos
1 Reply
ODWC_GIS
Frequent Contributor

The solution was to Encode all the URL Parameters associated with the long URL.

0 Kudos