|
POST
|
The quotes are incorrect on the SQL Statement within the Filter function. It should like this: "Encroachment_Type_1 = 'Mowing (turf grass)' OR Encroachment_Type_2 = 'Mowing (turf grass)' OR Encroachment_Type_3 = 'Mowing (turf grass)'" Since the Filters appear to be the same except for the layerID, you can use a loop to simplify things. var ids = [0, 1, 2];
var MowingCount = 0;
for (var id of ids) {
MowingCount += Count(
Filter(
FeatureSetByPortalItem(
Portal("https://www.arcgis.com"),
"itemID",
id,
["Encroachment_Type_1", "Encroachment_Type_2", "Encroachment_Type_3"],
false
),
"Encroachment_Type_1 = 'Mowing (turf grass)' OR Encroachment_Type_2 = 'Mowing (turf grass)' OR Encroachment_Type_3 = 'Mowing (turf grass)'"
)
);
}
return MowingCount;
... View more
14 hours ago
|
0
|
0
|
13
|
|
POST
|
You can use the ArcGIS Assistant to change the datasource. I would recommend trying it out on a copy of your webmap to make sure it's making the change correctly, since you're editing the underlying JSON file that powers the webmap. Start by reading the instruction guide.
... View more
Friday
|
0
|
0
|
81
|
|
POST
|
And as an aside, didn't the sample pages used to have a feedback mechanism, similar to the "Was this page helpful?" link in the lower right corner in the API reference pages? Clicking Yes or No provided a dialog so you could send an email about an issue on the page.
... View more
Thursday
|
0
|
0
|
115
|
|
POST
|
Have you checked the distance attribute for those other features? You'll only get returns if the values exactly match 200, 400, or 600.
... View more
Tuesday
|
0
|
0
|
126
|
|
POST
|
When posting code, please use the "Insert/edit code sample" button. This makes it easier to read or copy your code. You can create a single feature from the roadlessIntersect FeatureSet and using that in the intersection with the speciesRanges FeatureSet. To do this, loop through the FeatureSet and add the features to an array. Use the Union function to create the single feature from that array. var roadlessIntersect = Intersects(RoadlessRule, $feature)
var features = []
for (var f in roadlessIntersect) {
Push(features, f)
}
var roadlessFeature = Union(features)
var speciesIntersect = Intersects(speciesRanges, roadlessFeature)
... View more
2 weeks ago
|
0
|
0
|
32
|
|
POST
|
Esri can be frustrating like that sometimes! What was the final solution? You should click the "Accept as Solution" button in the post with the correct solution (even it was yours!). This will help others search for the same sort of answer.
... View more
2 weeks ago
|
0
|
0
|
73
|
|
POST
|
The variable substitution sqlExpression in line 39 is not correct. You'd have to do something like this var globalId = p.globalid
var related = Filter(comments, "projectguid = @globalId");
... View more
4 weeks ago
|
1
|
1
|
202
|
|
POST
|
You can add an Arcade Element to your popup with this code. It loops through each field in the feature and returns only the fields that contain a value. This also includes a variable (exceptedFields) that contains fields you don't want to show in the field list. Note that those field names are case sensitive. Expects($feature, "*");
var fields = Schema($feature).fields;
var attributes = {};
var fieldInfos = [];
var exceptedFields = ["OBJECTID", "GlobalID"]; //case sensitive!
for (var f of fields) {
if (!Includes(exceptedFields, f.name)) {
if (Trim($feature[f.name]) != "") {
attributes[f.alias] = $feature[f.name];
Push(fieldInfos, { fieldName: f.alias });
}
}
}
return { type: "fields", fieldInfos: fieldInfos, attributes: attributes };
... View more
a month ago
|
2
|
1
|
233
|
|
POST
|
You can use the GroupBy function to calculate this var fs = FeatureSetByPortalItem(
Portal("https://www.arcgis.com"),
"yourID",
0,
['County','Year', 'curr_enr','prev_enr'],
false
)
GroupBy(fs, ['County','Year','curr_enr','prev_enr'], {name: 'Change', expression: '(curr_enr - prev_enr)/prev_enr', statistic: 'Max'})
... View more
a month ago
|
1
|
1
|
308
|
|
POST
|
Also note that you can make the When statement more concise var tod = When(hour >= 0 && hour <= 5, "Night",
hour <= 8, "Morning",
hour <= 15, "Day",
hour <= 23, "Evening",
Null
);
... View more
a month ago
|
1
|
1
|
320
|
|
POST
|
Are you viewing this in Firefox? There have been reports of some issues with Firefox v145.0 That said, I'm seeing the Preview button on my machine using ExB DE 1.18 in both Firefox and Chrome.
... View more
11-14-2025
08:35 AM
|
0
|
2
|
334
|
|
POST
|
You can write a function that returns the color for the attribute passed in as a parameter. function bgColor(attribute) {
when (attribute <= 70, "red",
attribute <= 80, "orange",
attribute <= 90, "yellow",
attribute <= 95, "green",
"blue")
}
//in use
var theColor = bgColor($feature.attribute)
... View more
11-14-2025
07:57 AM
|
1
|
0
|
143
|
|
POST
|
It seems like there are some incompatibilities with the latest version of Firefox and Esri's products https://community.esri.com/t5/community-feedback/map-viewer-issues-when-using-firefox-version-145-0/m-p/1665688#M6016 https://community.esri.com/t5/arcgis-enterprise-portal-questions/issue-with-layer-widget-display-in-experience/m-p/1665001
... View more
11-14-2025
06:00 AM
|
0
|
1
|
399
|
|
POST
|
In the Indicator tab, turn off the Unit prefix option
... View more
11-14-2025
05:50 AM
|
3
|
0
|
318
|
|
POST
|
OK, this should give you what you're trying to do, but I haven't tested it. It loops through each tract, gets the intersecting lakes for that tract, then gets the intersecting area for each lake. Then it gets the total lake count. Note that the area is rounded to two decimal places. It will take a while to process. You could test whether "Memorizing" the tracts and lakes layers makes it any faster. var port = Portal("https://www.arcgis.com");
// Load layers
var tracts = FeatureSetByPortalItem(port, "b9fcbedac0384e32bc3dba6aec1a8cf6", 0);
var lakes = FeatureSetByPortalItem(port, "5564b2e702364aefba08df8c95216a1f", 0, ["OrgKeyID"]);
var lakesfilt = Filter(lakes, "OrgKeyID > 0");
var totalAcres = 0;
var arrTracts = [];
for (var tract in tracts) {
var intersectingLakes = Intersects(lakesfilt, tract);
Push(arrTracts, tract);
for (var intersectingLake in intersectingLakes) {
var lakePart = Intersection(tract, intersectingLake);
totalAcres += Area(lakePart, "acres");
}
}
var lakeCount = Count(Intersects(lakesfilt, Union(arrTracts)))
return FeatureSet(
{
fields: [
{ name: "LakeCount", type: "esriFieldTypeInteger" },
{ name: "Acres", type: "esriFieldTypeDouble" }
],
features: [
{ attributes: { LakeCount: lakeCount, Acres: Round(totalAcres, 2) } }
]
}
);
... View more
11-13-2025
01:27 PM
|
1
|
1
|
428
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 2 | a month ago | |
| 1 | a month ago | |
| 1 | a month ago | |
| 1 | 11-14-2025 07:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|