|
POST
|
Here's a way to create a bulleted list. In each loop, the string is pushed into the result array. The string also use a template literal. The Concatenate function creates a string from that array, separating the array items by a line break. As for the AsBuilt_Name not coming through, have you checked using a console in your loop whether there's an attribute in that field? var AB = FeatureSetByName($map, 'As Built Polygons')
var ABpoly = Intersects(AB, $userInput)
// uses the intersect of the click//
var result = []
for (var poly in ABpoly){
var link = poly.AsBuilt_Link
var name = poly.Laser_fiche_name
var yr = poly.year
var nm = poly.AsBuilt_Name
console(nm)
Push(result, `• ${nm} <a href =${link}>${name}</a> ${yr}`)
}
//pulls the fields from the layer and builds a url using the field name//
return {
type: 'text',
text : Concatenate(result, '<br>')
}
... View more
03-23-2026
08:30 AM
|
0
|
2
|
528
|
|
IDEA
|
When adding a zip file as a New Item, the only option for custom widgets is "AppBuilder widget package". Since ArcGIS Web AppBuilder has been deprecated, add an option for Experience Builder widgets packages.
... View more
03-19-2026
12:59 PM
|
1
|
0
|
179
|
|
IDEA
|
This idea has been floating around for a loooong time Additional Folders/ Sub-Folders in My Content - Esri Community (2013) Enable subfolders in ArcGIS Online - Esri Community (2023)
... View more
03-19-2026
12:02 PM
|
0
|
0
|
427
|
|
POST
|
This idea is over four years old and a major version ago. It's still at the "Open" status. Are there any indications it's ever going to be moved into the "Under Consideration" status? Could it make in into ArcGIS Pro 4.x?
... View more
03-18-2026
10:47 AM
|
0
|
1
|
539
|
|
POST
|
What are the symbol classes that are being returned? Do you have values in ASSETTYPE and ownedby that will return all possible classes? Arcade will not create a symbol for a value that isn't in the attributes. For example, if you don't have any ASSETTYPE == 30, the legend will not have the classes from lines 6 or 7. When I create a legend from an Arcade script, I'll put in dummy values in the attributes to get all the possible combinations, then remove them after running the script. This is another way to write your script var x2 = $feature.ASSETTYPE;
var z2 = $feature.ownedby;
var x = iif(x2 >= 7 && x2 <= 10, "Plastic", DomainName($feature, 'ASSETTYPE'));
return iif(z2 == 30, DomainName($feature, 'ownedby') + " " + x, x);
... View more
03-18-2026
06:57 AM
|
0
|
0
|
250
|
|
POST
|
My apologies. I forgot to add a wildcard in the sqlExpression. Here's the tested code that works var fs = FeatureSetByName($datastore, "GIS_Miway_LandingPad");
var string = `${$feature.StopID_text}-LP-`
var sql = `${string}%`;
var filtered = Filter(fs, "AssetID LIKE @sql");
if (Count(filtered) == 0) return `${string}1`;
var list = [];
for (var f in filtered) {
Push(list, f["AssetID"]);
}
function reverseSort(a, b) {
if (a < b) return 1;
if (a > b) return -1;
return 0;
}
var highest = Sort(list, reverseSort)[0]
return `${string}${Number(Split(highest, "-LP-")[1]) + 1}` In my test data, I used the Habitat field
... View more
03-13-2026
09:50 AM
|
3
|
1
|
1226
|
|
POST
|
When posting code, use the "Insert/Edit code sample" button. The syntax is incorrect on the Filter's sqlExpression var filtered = Filter(fs, "AssetID LIKE @sql");
... View more
03-13-2026
06:03 AM
|
0
|
3
|
1245
|
|
POST
|
I was looking at it another way, incrementing the counter for the unique values of `${$feature.Field1}-BB-` I haven't tested it, but was thinking along these lines var fs = FeatureSetByName($datastore, "yourLayer");
var sql = `${$feature.Field1}-BB-`;
var filtered = Filter(fs, "Field2 LIKE @sql");
if (Count(filtered) == 0) return `${$feature.Field1}-BB-1`;
var list = [];
for (var f in filtered) {
Push(list, f["Field2"]);
}
function reverseSort(a, b) {
if (a < b) return 1;
if (a > b) return -1;
return 0;
}
var highest = Sort(list, reverseSort)[0]
return `${$feature.Field1}-BB-${Number(Split(highest, "-BB-")[1])+ 1}` In line 3, the FeatureSet is filtered to only show the existing values for that field. If there aren't any, it returns the string with the counter = 1 in line 4. Lines 6-9 create a list of the values in Field2. Lines 11-15 are a reverse sorting function (taken from the Sort example) to get the highest value in line 17. Line 18 returns the string and the highest value incremented by one.
... View more
03-12-2026
08:19 AM
|
2
|
1
|
1299
|
|
POST
|
This would return the first seven characters attrs["Category"] = Left(f["Type"], 7);
... View more
03-09-2026
10:09 AM
|
0
|
0
|
591
|
|
POST
|
How would you determine which 25 tracts to use? Is your dataset only those 25 tracts?
... View more
03-09-2026
07:27 AM
|
0
|
0
|
247
|
|
POST
|
Here's one way to create that new field. This takes the Schema of your original FeatureSet (line 9) and adds the additional field "Category" (line 10). It creates a dictionary for a new FeatureSet (lines 12-16), then loops through the records in the original Featureset (line 17) and copying all the attributes (lines 20-22). For the new "Category" field, it takes the value from the "Type" attribute, splits it into an array, and extracts the text before the colon (line 23). The attributes are added into a new feature (line 25) and a new FeatureSet is created from the dictionary (line 27). var fs = FeatureSetByPortalItem(
Portal("yourPortal"),
"yourItem",
0,
["*"],
false
);
var theSchema = Schema(fs);
Push(theSchema.fields, { name: "Category", type: "esriFieldTypeString" });
//return theSchema;
var temp_dict = {
fields: theSchema["fields"],
geometryType: Schema(fs).geometryType,
features: []
};
for (var f in fs) {
var attrs = {};
for (var attr in f) {
attrs[attr] = f[attr];
}
attrs["Category"] = Split(f["Type"], ":")[0];
Push(temp_dict["features"], { attributes: attrs, geometry: Geometry(f) });
}
return Featureset(temp_dict);
... View more
03-09-2026
07:18 AM
|
0
|
2
|
606
|
|
POST
|
In my experience, the text environment uses the first item, whether its a feature or pixel. I'm guessing the first "pixel" is null but all the others will return a valid response. I would also get the execution error when running it there. However, as shown in the image, I do see what the keys are in the $pixel dictionary. The reason I was using "Raster.ItemPixelValue" was that it's shaded relief image. The "Raster.ServicePixelValue" key returned an array like ["69","176","45"], representing the red, green, and blue values.
... View more
03-04-2026
11:25 AM
|
1
|
0
|
840
|
|
POST
|
I was using this image service. Also, when using an Arcade element, you have to return a dictionary return {
type : 'text',
text : `Pixel Value: ${Number($pixel["Raster.ItemPixelValue"][0])}`
}
... View more
03-04-2026
10:54 AM
|
0
|
2
|
846
|
|
POST
|
This code works in my popup. I get an error in the console when running it, because everything in $pixel is null in the test environment, but it does have values in the popup
... View more
03-04-2026
10:18 AM
|
0
|
5
|
853
|
|
POST
|
From the way I read it, your code would only return two items. Take a look at the second example in the documentation: Your track has a field named Speed with sequentially ordered values of [10, 20, 30, 40, 50]. The geometries of the features are [{x: 1, y: 1},{x: 2, y: 2} ,{x: null, y: null},{x: 4, y: 4}, {x: 5, y: 5}]. The expression is evaluated at each feature in the track. For this example, we examine results when evaluated at the third feature (30). Results are returned inclusive of the start feature, and exclusive of the end feature. var window = TrackFieldWindow('Speed', -2,2)window;// returns [10,20,30,40] What happens when you use this syntax? // Get last 3 speed observations
var speeds = TrackFieldWindow("speedInMph", -2, 1);
// Check that all 3 speeds are > 25 MPH
return
Count(speeds) >= 3 &&
speeds[0] > 25 &&
speeds[1] > 25 &&
speeds[2] > 25;
... View more
03-03-2026
11:14 AM
|
0
|
0
|
382
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM | |
| 1 | 10-11-2023 06:18 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|