|
POST
|
You can use the Top function to do this. The example in the documentation shows how to get the top 5 features with the highest population with the addition of the OrderBy function. Top( OrderBy($layer, 'POPULATION DESC'), 5 )
... View more
10-13-2023
08:16 AM
|
3
|
0
|
3319
|
|
POST
|
Filter returns a FeatureSet and you need the first feature in that set for your IFF function. var routeFilter = First(Filter(lrsRoute, "ROUTEID = @routeID"));
... View more
10-13-2023
08:09 AM
|
0
|
0
|
1627
|
|
POST
|
It depends on what you're trying to do. Some profiles, like Popup, give you access to the $map profile variable, while Attribute Rules gives you access to the $datastore variable.
... View more
10-12-2023
10:26 AM
|
0
|
1
|
3093
|
|
POST
|
This is how you return the descriptive name Concatenate([text($feature.Unit_Number), DomainName($feature, 'Stream_Habitat')], ' ')
... View more
10-11-2023
06:18 AM
|
1
|
1
|
1002
|
|
POST
|
Can you give an example of what content you would like to see in the popup?
... View more
10-10-2023
06:17 AM
|
0
|
0
|
2178
|
|
POST
|
You can get the alias of the field by first getting the schema of either the feature or layer.That returns a dictionary of the fields and their names, aliases, types, and other information. In this example, I'm constructing a list of the field aliases for fields that contain the word "MAX" in the field name and have a value of one. var theSchema = Schema($feature);
var fields = theSchema['fields'];
var species = [];
for (var i in fields) {
if (Find('MAX', fields[i]['name']) > -1 && $feature[fields[i]['name']] == 1) {
Push(species,fields[i]['alias']);
}
}
... View more
10-05-2023
07:19 AM
|
0
|
2
|
2243
|
|
POST
|
Have you tried applying the API key to the layer itself? https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#apiKey
... View more
10-05-2023
06:08 AM
|
0
|
1
|
2235
|
|
POST
|
Thanks for correcting my mistake about the output of this Intersects. And I'm surprised that order doesn't matter. It's great that it will sort out what is the feature and what is the set, but it's not something to count on for all functions!
... View more
10-04-2023
11:46 AM
|
0
|
0
|
2547
|
|
POST
|
You're using the Intersects function for FeatureSet, where the parameters are in the order of features, then inputGeometry. You're providing them in reverse. Try this, which uses IIf to simply the returns: // Variable containing impaired catchment feature
var ImpCatchments = FeatureSetByName($datastore, "Catchments_Impaired")
//If larger watershed boundary feature intersects with any smaller impaired catchments features return "Y/N"
IIf (Intersects(ImpCatchments, $feature), "Y", "N");
... View more
10-04-2023
10:45 AM
|
1
|
3
|
2559
|
|
POST
|
If you have a relate set up for the two tables, you can use the FeatureSetByRelationshipName function var relatedFS = FeatureSetByRelationshipName($feature, 'relate name');
return First(relatedFS).TDA_ID If they don't have a relationship, a note about constructing the sqlExpression for the Filter. You can make use of the Arcade variable substitution so you don't have to worry whether a value needs quotes or not var tdaid = $feature.TDA_ID;
var relatedFeature = First(Filter(originFeatureSet, "TDA_ID = @tdaid"));
... View more
10-04-2023
07:14 AM
|
1
|
1
|
1724
|
|
POST
|
Another way to do this is to make a new FeatureSet containing the fields you want to list. This example uses the sample FeatureSet from the Playground, converting the BUILDINGIDs to a number and sorts them. // Fetches features from a public portal item
var fs = FeatureSetByPortalItem(
Portal("https://www.arcgis.com"),
// portal item id
"6200db0b80de4341ae8ee2b62d606e67",
0, // layer id
["*"], // fields to include
true // include or exclude geometry
);
var filteredfs = Filter(fs, "OBJECTID < 20") //take only the first 20, since the full FeatureSet has 68K records and takes a while to process
//return OrderBy(filteredfs, "BUILDINGID DESC") - this checks the order of the original FeatureSet, showing the problem of sorts by text values
var features = [];
for (var f in filteredfs) {
var num = Number(f.BUILDINGID);
//this line removes the last character if it isn't numeric
if (IsNan(Number(Right(f.BUILDINGID,1)))) num = Number(Left(f.BUILDINGID, Count(f.BUILDINGID)-1));
var feat = {
'attributes': {
'newID': num,
'oldID':f.BUILDINGID
}
};
Push(features, feat)
}
var out_dict = {
'fields': [
{'name': 'newID', 'alias': 'New ID', 'type': 'esriFieldTypeInteger'},
{'name': 'oldID', 'alias': 'Old ID', 'type': 'esriFieldTypeString'}
],
'geometryType': '',
'features': features
};
// Convert dictionary to feature set.
var newfs = FeatureSet(Text(out_dict));
return OrderBy(newfs, 'newID DESC')
... View more
10-02-2023
03:07 PM
|
1
|
0
|
3448
|
|
POST
|
What are the actual values for tempF and humidity? I tested this with several values for T and RH.
... View more
10-02-2023
02:27 PM
|
0
|
1
|
2439
|
|
POST
|
This uses the formulas on the NOAA National Weather Service's Heat Index Equation page. var T = 80; //Temperature in °F
var RH = 12; //Relative Humidity
var HI = -42.379 + 2.04901523*T + 10.14333127*RH - .22475541*T*RH - .00683783*T*T - .05481717*RH*RH + .00122874*T*T*RH + .00085282*T*RH*RH - .00000199*T*T*RH*RH;
if (RH < 13 && T > 80 && T < 112) HI -= ((13-RH)/4)*SQRT((17-ABS(T-95.))/17);
if (RH > 85 && T > 80 && T < 87) HI += ((RH-85)/10) * ((87-T)/5);
if (HI < 80) HI = 0.5 * (T + 61.0 + ((T-68.0)*1.2) + (RH*0.094));
return HI; The calculated value can be checked through the Heat Index Calculator page.
... View more
10-02-2023
01:47 PM
|
1
|
3
|
2445
|
|
POST
|
According to the functionality matrix, there are no plans to add screenUtils. You can use the toMap and toScreen methods in both MapView and SceneView.
... View more
09-30-2023
05:22 AM
|
0
|
1
|
1642
|
|
POST
|
Here's an example showing that it does work. This is using the field ANNUALTAX. This shows the popup with two decimal places and a 1000s separator. popup1.png popup2.png Then I changed the decimal places to 0 and turned off the separator. popup3.png popup4.png
... View more
09-29-2023
11:39 AM
|
1
|
2
|
5015
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | 2 weeks ago | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|