Select to view content in your preferred language

Links in popups

274
4
Jump to solution
06-12-2025 08:00 AM
Labels (1)
JasonSimpson
Regular Contributor

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:

  1. It’s a URL that requires third-party access permissions, so our organization’s URL along with ArcGIS has been whitelisted.

  2. The URL includes dynamic text based on a field value.

  3. 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}

 

0 Kudos
2 Solutions

Accepted Solutions
Brian_McLeer
Frequent Contributor

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/>";
    }
}

Brian_McLeer_0-1749740945469.png

 

View solution in original post

0 Kudos
NicoleJohnson
Frequent Contributor

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?:

NicoleJohnson_0-1750277910453.png

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:

NicoleJohnson_1-1750278116830.png

Then, go back to the text content block and enter the expression number as the URL:

NicoleJohnson_2-1750278596509.png

 

View solution in original post

0 Kudos
4 Replies
Brian_McLeer
Frequent Contributor

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/>";
    }
}

Brian_McLeer_0-1749740945469.png

 

0 Kudos
JasonSimpson
Regular Contributor

Thank you for the suggestion. An arcade element worked. 

NicoleJohnson
Frequent Contributor

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?:

NicoleJohnson_0-1750277910453.png

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:

NicoleJohnson_1-1750278116830.png

Then, go back to the text content block and enter the expression number as the URL:

NicoleJohnson_2-1750278596509.png

 

0 Kudos
JasonSimpson
Regular Contributor

Thank you. I indeed created an arcade expression with the dynamic field being a var. 

0 Kudos