Select to view content in your preferred language

Arcade not passing value to URL

1070
3
Jump to solution
05-12-2022 09:12 AM
MikeOnzay
Frequent Contributor

Trying to pass a value to a URL. Same pattern that I use on a different layer to link to items in a different SP site.

Note: for this post I renamed the URL to my sharepoint site to myurl.

var url = 'myurl/'

var addr = UrlEncode($feature.Address) - (testing works without using urlencode too)

var con = concatenate(url,addr,'.pdf')
return con

Test shows this: https://myurl/717%20FIRST%20ST.pdf. It opens the card

Back in the map the hyperlink is always missing the address. https://myurl/.pdf

I tried this:

return 'https://myurl/' + $feature.Address+'.pdf' and it didn't pass the address in the popup but in the Arcade test window it was correct.

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

It's odd, the way you're using Concatenate isn't really documented, but it does work.

jcarlson_0-1652373899785.png

The documented use of the function is to supply an array of items and the separator character(s), and an optional formatting string (if you're concatenating dates and numbers, for instance).

Could you try writing your expression this way and see if it behaves any differently?

jcarlson_1-1652374144853.png

 

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

It's odd, the way you're using Concatenate isn't really documented, but it does work.

jcarlson_0-1652373899785.png

The documented use of the function is to supply an array of items and the separator character(s), and an optional formatting string (if you're concatenating dates and numbers, for instance).

Could you try writing your expression this way and see if it behaves any differently?

jcarlson_1-1652374144853.png

 

- Josh Carlson
Kendall County GIS
0 Kudos
MikeOnzay
Frequent Contributor

Tried it your suggested way and I still received the same result as I did before. I did notice that if I open the table, I can see all the correct URLs in each row. Clicking on any link will open the file It is just not working in the actual popup

0 Kudos
MikeOnzay
Frequent Contributor

I checked this in Edge and the URL was populating in the popup. I opened an existing WAB in Chrome that uses this map, and the popup was correct. I went back to Chrome, opened the map and it is populating now. I didn't clear the cache so I don't know why it started working. However, in Field Maps, which is primarily how our field crews access this map, the attribute for this expression is empty. Maybe there is Field Maps configuration I have to set.

0 Kudos