|
POST
|
Just a warning that line 7 will crash the code. You'd have to return something like the count of the FeatureSet or get the first feature to get the Locationname attribute like you have in line 8.
... View more
3 weeks ago
|
1
|
0
|
256
|
|
POST
|
In this case, you'd want to use AND instead of OR. I think the confusing part for this query is that it uses NOT in conjunction with the OR. That will result in only filtering out the features that have "Canal" and are of ftype of 460 or 428. A feature of ftype 460 will be returned if it doesn't contain "Canal". To illustrate that, I have a sample dataset where I'm filtering by Region and Field_ID. The original data looks like this If I apply a query like you have to remove records that don't have 1 in the region name or are not 6563, 6564, or 6565, then the only record removed is the one with PRICO1 and 6564. If I use AND in that query, then the three records are removed that meet either criteria
... View more
3 weeks ago
|
2
|
1
|
231
|
|
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
3 weeks ago
|
0
|
0
|
132
|
|
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
4 weeks ago
|
0
|
0
|
165
|
|
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
4 weeks ago
|
0
|
0
|
238
|
|
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
a month ago
|
0
|
0
|
233
|
|
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
12-04-2025
08:22 AM
|
0
|
0
|
82
|
|
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
12-04-2025
06:09 AM
|
0
|
0
|
193
|
|
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
11-18-2025
12:30 PM
|
1
|
1
|
315
|
|
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
11-18-2025
06:53 AM
|
2
|
1
|
308
|
|
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
11-17-2025
07:00 AM
|
1
|
1
|
528
|
|
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
11-17-2025
06:38 AM
|
1
|
1
|
448
|
|
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
|
408
|
|
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
|
181
|
|
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
|
477
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 2 | 3 weeks ago | |
| 1 | 11-18-2025 12:30 PM | |
| 2 | 11-18-2025 06:53 AM | |
| 1 | 11-17-2025 06:38 AM |
| Online Status |
Offline
|
| Date Last Visited |
42m ago
|