I’m currently in the process of transitioning to Experience Builder for a popular application within our organization and encountering issues with the URL in a popup within the built-in map viewer.
To provide some context about the URL:
It’s a URL that requires third-party access permissions, so our organization’s URL along with ArcGIS has been whitelisted.
The URL includes dynamic text based on a field value.
A static version of this URL works fine when linked to a button in Experience Builder, but it doesn’t function properly within the popup.
Below is an example of the URL being used. Any suggestions or solutions would be greatly appreciated.
https://www.organization.com/RealProperty/ThirdPartyAccess?countyId=00000&rpid={FIELDNAME}
Solved! Go to Solution.
I had to migrate some code from WAB to EB, and below is a snippet of my Arcade (most may not be relevant to you, but the last else may be). The workflow I use is is to add an Arcade element to the pop-up.
// Function to format URL fields
function formatURL(label, value) {
var lowerValue = Lower(Text(value));
// Handle Trimview and other special cases
if (Left(lowerValue, 4) == "map/" || Left(lowerValue, 4) == "poa/" || Left(lowerValue, 4) == "ord/" || Left(lowerValue, 4) == "phot" || Left(lowerValue, 4) == "fldr" || Left(lowerValue, 4) == "ldoc") {
return "<b>" + label + ":</b> <a target='_blank' href='http://your.org.com/?=" + value + "'>Click here for more info.</a><br/>";
} else if (Left(lowerValue, 7) == "http://" || Left(lowerValue, 8) == "https://") {
return "<b>" + label + ":</b> <a target='_blank' href='" + value + "'>Click here for more info.</a><br/>";
} else if (Right(lowerValue, 4) == ".pdf" || Right(lowerValue, 5) == ".xlsx") {
// Handle PDF and Excel (.xlsx) files
return "<b>" + label + ":</b> <a target='_blank' href='http://your.org.com/" + value + "'>Click here for more info.</a><br/>";
} else if (Find("pavement\\", lowerValue) != -1) {
// Handle cases where URL is like "pavement\pavement2022\..."
return "<b>" + label + ":</b> <a target='_blank' href='https://your.org.com/" + value + "'>Click here for more info.</a><br/>";
} else if (Find("resdoc/", lowerValue) != -1) {
// Handle cases where URL is like "resdoc/6200"
return "<b>" + label + ":</b> <a target='_blank' href='https://your.org.com/" + value + "'>Click here for more info.</a><br/>";
} else {
// Fallback to URL format for any other URL-like fields
return "<b>" + label + ":</b> <a target='_blank' href='http://your.org.com/" + value + "'>Click here for more info.</a><br/>";
}
}
You can use an Arcade content block like above, or you can create the URLs with an Arcade attribute expression. You don't state how you're currently creating the URLs, so I'm guessing that you're entering the URL like this?:
For the same use case, here's what I've done:
Add a text content block to your pop-up (if you don't already have one). Create an Arcade attribute expression. Whatever the static part of the URL is, put that in quotes, then concatenate the dynamic field info:
Then, go back to the text content block and enter the expression number as the URL:
I had to migrate some code from WAB to EB, and below is a snippet of my Arcade (most may not be relevant to you, but the last else may be). The workflow I use is is to add an Arcade element to the pop-up.
// Function to format URL fields
function formatURL(label, value) {
var lowerValue = Lower(Text(value));
// Handle Trimview and other special cases
if (Left(lowerValue, 4) == "map/" || Left(lowerValue, 4) == "poa/" || Left(lowerValue, 4) == "ord/" || Left(lowerValue, 4) == "phot" || Left(lowerValue, 4) == "fldr" || Left(lowerValue, 4) == "ldoc") {
return "<b>" + label + ":</b> <a target='_blank' href='http://your.org.com/?=" + value + "'>Click here for more info.</a><br/>";
} else if (Left(lowerValue, 7) == "http://" || Left(lowerValue, 8) == "https://") {
return "<b>" + label + ":</b> <a target='_blank' href='" + value + "'>Click here for more info.</a><br/>";
} else if (Right(lowerValue, 4) == ".pdf" || Right(lowerValue, 5) == ".xlsx") {
// Handle PDF and Excel (.xlsx) files
return "<b>" + label + ":</b> <a target='_blank' href='http://your.org.com/" + value + "'>Click here for more info.</a><br/>";
} else if (Find("pavement\\", lowerValue) != -1) {
// Handle cases where URL is like "pavement\pavement2022\..."
return "<b>" + label + ":</b> <a target='_blank' href='https://your.org.com/" + value + "'>Click here for more info.</a><br/>";
} else if (Find("resdoc/", lowerValue) != -1) {
// Handle cases where URL is like "resdoc/6200"
return "<b>" + label + ":</b> <a target='_blank' href='https://your.org.com/" + value + "'>Click here for more info.</a><br/>";
} else {
// Fallback to URL format for any other URL-like fields
return "<b>" + label + ":</b> <a target='_blank' href='http://your.org.com/" + value + "'>Click here for more info.</a><br/>";
}
}
Thank you for the suggestion. An arcade element worked.
You can use an Arcade content block like above, or you can create the URLs with an Arcade attribute expression. You don't state how you're currently creating the URLs, so I'm guessing that you're entering the URL like this?:
For the same use case, here's what I've done:
Add a text content block to your pop-up (if you don't already have one). Create an Arcade attribute expression. Whatever the static part of the URL is, put that in quotes, then concatenate the dynamic field info:
Then, go back to the text content block and enter the expression number as the URL:
Thank you. I indeed created an arcade expression with the dynamic field being a var.