|
POST
|
@Ke_Xu, I think I found the missing step. Originally, I was trying to correlate a search web map with a separate web map that I was using in the Map Widget. After adding the search layers to the map that is being used in the Map Widget, I was able to construct the steps in Experience Builder to get the pop-up to show the item being searched. 1. Add search layers to the web map, and turn off visibility. 2. Turn off the show in the map legend. 3. Enable and configure pop-ups. 4. In Experience Builder Developer Edition, add the search layer as a new search source from the layer source. 5. Under the Action tab, if needed add a newly added source to Zoom and/or Pan trigger. 6. Add action and framework, Select Data Records, and Select newly added search layer as Trigger data and Action data. 7. If needed in Layer List, uncheck the newly added search layer so it is not visible. Search for a parcel number, map will zoom to and open a pop-up, Reference: https://www.youtube.com/watch?v=eoNje-ZY28k&list=PLeXjHxbU5lmZW2qMTokPl0KOU_E1wrzjA&index=4
... View more
08-30-2024
09:26 AM
|
0
|
0
|
1275
|
|
IDEA
|
When on the map widget, users should be able to enter coordinates on the Initial View Custom. When you click on Modify, you can pan and zoom, but you cannot enter coordinates. This would be helpful to keep default loading extents for multiple applications the same. If an organization has multiple Experience Builder apps, keeping the default extent on all of them would help with consistency. I know that you can edit the extent under the General Settings of the item, but that does not appear to be related to the default map extent when loaded initially.
... View more
08-29-2024
03:18 PM
|
1
|
2
|
567
|
|
POST
|
Hi @Ke_Xu, yes, the Auto select the first result was enabled in the Search widget.
... View more
08-28-2024
08:24 AM
|
0
|
1
|
1324
|
|
POST
|
Thank you @sylvainhotte1, I appreciate you being open to sharing it.
... View more
08-28-2024
07:03 AM
|
0
|
0
|
1669
|
|
POST
|
I think you have to add the "" function to check for if a part is empty. // List the fields to combine
var parts = [$feature.ST_NUM, $feature.DIRPRE, $feature.FEANME, $feature.FEATYP, $feature.DIRSUF, $feature.LV_APT];
// Function to check if a value is null or empty
function IsNullOrEmpty(value) {
return value == null || value == "";
}
// Loop through the address parts, if not null or empty add them to a new array
var filteredparts = [];
for (var i in parts) {
var value = parts[i];
if (IsNullOrEmpty(value)) continue;
filteredparts[Count(filteredparts)] = value;
}
// Concatenate with a space
return Concatenate(filteredparts, " ");
... View more
08-27-2024
01:51 PM
|
0
|
1
|
2310
|
|
POST
|
This question stems from this Esri Community post. The post linked tends to relate to the search widget within the map widget and not the search widget itself. I have a series of map services within a web map that I will use in the search widget (not the Search radio button on the map widget). When a user searches one of the layers, the result they select should have a pop-up equal to how it is set in the web map such as below. With the article linked in this post, has anyone had any success in doing this through actions and triggers on the Search widget? Checklist of things I have done: - Enabled/configured pop-ups in web map. - Enabled pop-up upon feature selection on the web map in Experience Builder Developer.
... View more
08-26-2024
12:28 PM
|
1
|
3
|
1419
|
|
POST
|
I think I answered my own question. You can edit the HTML in the text element, but the OK button gets greyed out. You have to exit the HTML mode then click ok.
... View more
08-23-2024
03:09 PM
|
0
|
0
|
1631
|
|
POST
|
I am trying to use a text element with two attribute expressions. I want the URL field in the pop-up to hyperlink to the URL, but have it display "Click here for more info." I can get it to hyperlink to where I want it to go, but it is showing the full URL, not the alias I am looking for. Currently, this is what it shows. 1st expression {expression/expr0} var annexYear = $feature.ANNEX_YEAR;
var annexDate = $feature.ANNEX_DATE;
var acres = $feature.ACRES;
var name = $feature.ANNEX_NAME;
var annexationDate = Text($feature.AnnexationDate, "MMMM D, YYYY");
return "Annex Year: " + annexYear + "\n" +
"Annex Date: " + annexDate + "\n" +
"Acres: " + acres + "\n" +
"Name: " + name + "\n" +
"Annexation Date: " + annexationDate + "\n"; 2nd expression {expression/expr1} var link = 'https://server.domain.com/maps/' + UrlEncode($feature.URL);
return link Text element: {expression/expr0} URL: {expression/expr1}
... View more
08-23-2024
03:01 PM
|
0
|
1
|
1640
|
|
POST
|
@sylvainhotte1 Would you be willing to share your widget?
... View more
08-22-2024
03:17 PM
|
0
|
3
|
1727
|
|
POST
|
@Caitlin, I am having the same issue. Is there any way you can post your attribute expression and how you inserted it into the text element?
... View more
08-22-2024
08:13 AM
|
0
|
1
|
6904
|
|
POST
|
@MariusVerdes It looks like if you type the .xlsx extension at the end of the file name in the GP tool you can get the xlsx file format. The output folder shows that it supports XLS or XLSX
... View more
08-20-2024
08:46 AM
|
5
|
0
|
2013
|
|
POST
|
@TonyAlmeida @HaydenWelch , apologies for the delayed response, I was not getting notifications on this post for some reason. It turned out the issue was that the Vector Tile Package could not overwrite the older file with the same name if it was in the same folder. I created a support ticket with Esri, and we discovered that if I moved the original VTPK to a folder, and then had the script import the newer VTPK with the same file name to the parent folder, it did not cause the issue.
... View more
08-16-2024
01:12 PM
|
0
|
0
|
765
|
|
POST
|
I am trying to batch-update multiple layers to all have the same Arcade content applied. I have found documentation on using a combination of Attribute Expressions / Text elements, but for the particular Arcade I am using, it only functions correctly if Arcade content is applied. I have looked through the developer documentation and it does not appear to call out Arcade as a popupElement supported function. Here is my current code, but ultimately I would like to remove the Attribute Expression and Text element and use Arcade as this works for hyperlinking out to URLs. from arcgis.gis import GIS
from arcgis.mapping import WebMap
# Step 1: Connect to the Portal
gis = GIS("https://portal.website.com/portal/", "username", "password")
# Step 2: Access the Web Map
webmap_item = gis.content.get("itemid")
webmap = WebMap(webmap_item)
# Function to clean popupInfo, remove attribute expressions, text boxes, and fields list
def clean_popup(layer):
# Update the layer title to remove ":" and references to "fields"
if "title" in layer:
original_title = layer["title"]
new_title = original_title.replace(':', '').replace('fields', '', 1).strip()
layer["title"] = new_title
if original_title != new_title:
print(f"Updated layer title from '{original_title}' to '{new_title}'")
# Clean the popupInfo to remove attribute expressions, fields list, and text boxes
if "popupInfo" in layer:
popup_info = layer["popupInfo"]
# Clear popupElements to remove Fields list, text elements, and any other custom elements
popup_info["popupElements"] = []
# Remove fieldInfos and attribute expressions (expressionInfos) completely
popup_info.pop("fieldInfos", None)
popup_info.pop("expressionInfos", None) # Removes any existing attribute expressions
# Remove other potential field-related properties
field_related_keys = ['displayField', 'description', 'showAttachments', 'mediaInfos']
for key in field_related_keys:
popup_info.pop(key, None)
print(f"Cleaned popupInfo for layer: {layer.get('title', 'Unnamed Layer')}")
# Function to add an Arcade attribute expression and reference it in a text element
def add_arcade_expression_as_text(layer):
if "popupInfo" in layer:
popup_info = layer["popupInfo"]
# Define the Arcade attribute expression
arcade_expression = {
"name": "customContent",
"title": "Custom Content",
"expression": """
var fieldsToExclude = ["OBJECTID", "OBJECTID_1", "SHAPE", "LAYERNAME", "GLOBALID", "SHAPE.STAREA()", "SHAPE.STLENGTH()", "CREATED_USER", "CREATED_DATE", "LAST_EDITED_USER", "LAST_EDITED_DATE", "LASTMODBY", "LASTMODDATE", "LASTSYNDATE"];
var content = "";
var seenUrls = {};
function formatURL(label, value) {
return label + ": <a target='_blank' href='" + value + "'>Click here for more info.</a>";
}
Expects($feature, "*");
var schemaDict = Schema($feature);
var fieldsArray = schemaDict["fields"];
function getFieldAlias(fieldName) {
for (var j = 0; j < Count(fieldsArray); j++) {
var fieldDict = fieldsArray[j];
if (fieldDict['name'] == fieldName) {
return fieldDict['alias'];
}
}
return fieldName;
}
function formatDate(dateValue) {
var date = Date(dateValue);
return Text(date, "MM/DD/YYYY");
}
function getDomainDescription(fieldDict, value) {
if (HasKey(fieldDict, "domain")) {
var domain = fieldDict["domain"];
if (domain != null && HasKey(domain, "codedValues")) {
for (var k = 0; k < Count(domain["codedValues"]); k++) {
var codedValue = domain["codedValues"][k];
if (codedValue["code"] == value) {
return codedValue["name"];
}
}
}
}
return value;
}
for (var i = 0; i < Count(fieldsArray); i++) {
var fieldDict = fieldsArray[i];
var fieldName = fieldDict["name"];
var alias = fieldDict["alias"];
var value = $feature[fieldName];
if (IndexOf(fieldsToExclude, Upper(fieldName)) == -1 && !IsEmpty(value) && Upper(Text(value)) != "NULL") {
if (Upper(Left(Text(value), 7)) == "HTTP://" || Upper(Left(Text(value), 8)) == "HTTPS://") {
if (!HasKey(seenUrls, value)) {
content += formatURL(alias, value) + "\\n";
seenUrls[value] = true;
}
} else if (fieldDict.type == "esriFieldTypeDate") {
content += alias + ": " + formatDate(value) + "\\n";
} else if (HasKey(fieldDict, "domain") && fieldDict["domain"] != null) {
var domainDescription = getDomainDescription(fieldDict, value);
content += alias + ": " + Text(domainDescription) + "\\n";
} else {
content += alias + ": " + Text(value) + "\\n";
}
}
}
return content;
"""
}
# Add the Arcade expression to the expressionInfos
if "expressionInfos" not in popup_info:
popup_info["expressionInfos"] = []
popup_info["expressionInfos"].append(arcade_expression)
# Reference the Arcade expression in a text element
text_element = {
"type": "text",
"text": "{expression/customContent}"
}
# Add the text element to the popupElements
popup_info["popupElements"].append(text_element)
print(f"Added Arcade expression as a text element to layer: {layer.get('title', 'Unnamed Layer')}")
# Recursive function to process all layers, including nested layers
def process_layers(layers):
for layer in layers:
clean_popup(layer)
add_arcade_expression_as_text(layer)
# Process sublayers if the layer is a group
if "layers" in layer:
print(f"Processing sublayers of group layer: {layer.get('title', 'Unnamed Layer')}")
process_layers(layer["layers"])
# Step 3: Process all layers, including those within group layers
process_layers(webmap.layers)
# Step 4: Save the updated Web Map
webmap.update()
print("All attribute expressions, fields lists, and text boxes removed, titles updated, and Arcade content added as a text element.") When I apply the below in an Arcade content section, the hyperlinks work. Whereas if I do it in an Attribute Expression and Text content, everything but the hyperlink works. var fieldsToExclude = ["OBJECTID", "SHAPE", "LAYERNAME", "GLOBALID", "SHAPE.STAREA()", "SHAPE.STLENGTH()", "CREATED_USER", "CREATED_DATE", "LAST_EDITED_USER", "LAST_EDITED_DATE", "LASTMODBY", "LASTMODDATE", "LASTSYNDATE"];
var content = "";
var seenUrls = {};
// Function to format URL fields
function formatURL(label, value) {
return "<b>" + label + ":</b> <a target='_blank' href='" + value + "'>Click here for more info.</a><br/>";
}
// Ensure all fields are available
Expects($feature, "*");
// Get the schema of the feature's layer
var schemaDict = Schema($feature);
var fieldsArray = schemaDict["fields"];
// Function to get the alias of a field
function getFieldAlias(fieldName) {
for (var j = 0; j < Count(fieldsArray); j++) {
var fieldDict = fieldsArray[j];
if (fieldDict['name'] == fieldName) {
return fieldDict['alias'];
}
}
return fieldName; // Fallback to field name if alias is not found
}
// Function to format dates as mm/dd/yyyy
function formatDate(dateValue) {
var date = Date(dateValue);
return Text(date, "MM/DD/YYYY");
}
// Function to get domain description
function getDomainDescription(fieldDict, value) {
// First, ensure that the domain key exists and is not null
if (HasKey(fieldDict, "domain")) {
var domain = fieldDict["domain"];
if (domain != null && HasKey(domain, "codedValues")) {
for (var k = 0; k < Count(domain["codedValues"]); k++) {
var codedValue = domain["codedValues"][k];
if (codedValue["code"] == value) {
return codedValue["name"];
}
}
}
}
return value; // Fallback to original value if no domain or match is found
}
// Iterate over each field in the schema to respect the field order
for (var i = 0; i < Count(fieldsArray); i++) {
var fieldDict = fieldsArray[i];
var fieldName = fieldDict["name"];
var alias = fieldDict["alias"];
var value = $feature[fieldName];
// Exclude certain fields and check if value is not empty
if (IndexOf(fieldsToExclude, Upper(fieldName)) == -1 && !IsEmpty(value) && Upper(Text(value)) != "NULL") {
// Check if the field value is a URL and format accordingly
if (Upper(Left(Text(value), 7)) == "HTTP://" || Upper(Left(Text(value), 8)) == "HTTPS://") {
if (!HasKey(seenUrls, value)) {
content += formatURL(alias, value);
seenUrls[value] = true;
}
} else if (fieldDict.type == "esriFieldTypeDate") {
// Format date fields
content += "<b>" + alias + ":</b> " + formatDate(value) + "<br/>";
} else if (HasKey(fieldDict, "domain") && fieldDict["domain"] != null) {
// Use domain description if available
var domainDescription = getDomainDescription(fieldDict, value);
content += "<b>" + alias + ":</b> " + Text(domainDescription) + "<br/>";
} else {
content += "<b>" + alias + ":</b> " + Text(value) + "<br/>";
}
}
}
return {
type: 'text',
text: content // this property supports HTML tags
};
... View more
08-16-2024
12:55 PM
|
1
|
2
|
905
|
|
IDEA
|
Adding a filter with checkboxes (like you can in Excel) would help manage content in AGOL\Portal. The use came when I was trying to filter on an owner, and there was no option.
... View more
08-16-2024
07:12 AM
|
3
|
0
|
289
|
|
POST
|
On version 1.15, I am trying to download an application. When doing so, I get an error that states "Failed to load" and the file does not download. Has anyone else had this happen?
... View more
08-15-2024
12:40 PM
|
0
|
4
|
1204
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | Tuesday | |
| 1 | a week ago | |
| 7 | 12-10-2025 03:48 PM | |
| 1 | 12-10-2025 12:19 PM | |
| 1 | 11-13-2025 07:02 AM |
| Online Status |
Online
|
| Date Last Visited |
yesterday
|