|
POST
|
Arcade will figure out which function you're using from the input parameters. I just tested this with my data and got the expected return value (this is using an Arcade element). var fs_parcels = FeatureSetByName($map, "Enterprise Zone", ['*'])
var targ_parcel = First(Intersects(fs_parcels, $feature))
var fs_addr_pts = FeatureSetByName($map, "Sub-Neighborhoods",['*'])
var parcel_addrs = Intersects(fs_addr_pts, targ_parcel)
var output = "returns " + count(parcel_addrs) + " addresses"
return {
type : 'text',
text : output
}
... View more
10-08-2024
07:11 AM
|
0
|
3
|
2565
|
|
POST
|
Here's another way of doing this var fields = ['JT', 'Veg', 'Plants', 'BUOW', 'CBB', 'DT', 'JD']
var output = []
for (var f in fields) {
var field = fields[f]
if ($feature[field] == 'Yes') Push(output, field)
}
When (Count(output) == 0, "NO SURVEYS COMPLETED",
Count(output) == 7, "ALL SURVEYS COMPLETED",
"Completed Surveys: " + Concatenate(output, "; "))
... View more
10-08-2024
06:35 AM
|
1
|
0
|
1125
|
|
POST
|
The Intersects function takes a FeatureSet and a Feature. Even though targ_parcel contains only one Feature, it's still considered a FeatureSet. What you have to do is get the First item of that FeatureSet (line 3) to use in the Intersects function. // gets addresses that belong to a single parcel
var fs_parcels = FeatureSetByName($map, "parcel layer", ['UPC','OWNER','OWNADD','SITUSADD'])
var targ_parcel = First(Intersects(fs_parcels, $feature)) //target parcel from clicking on point of interest
//console("returns " + Count(targ_parcel)+ " parcels")//gives me a count of 1, as expected
var fs_addr_pts = FeatureSetByName($map, "addr_points",['GeoAddress'])//creates feature set of address points in map
console("returns " + Count(fs_addr_pts))//returns 207,000 records found in featureset
//the next setp fails and doesn't return any features
var parcel_addrs = Intersects(fs_addr_pts, targ_parcel)
Console("returns " + count(parcel_addrs) + " addresses")
... View more
10-07-2024
01:11 PM
|
0
|
0
|
2609
|
|
POST
|
You have single quotes around "Internal_Status". Remove them and it should work.
... View more
10-04-2024
01:54 PM
|
2
|
1
|
1534
|
|
POST
|
This return statement will not give you the information you desire. The logical operator (&&) in the return can only return a true or false. In the if statement, you're checking whether the OBJECTID of the feature is 299. Since that is true, the conditions ($feature.OBJECTID==297) in the return will both be false. You also cannot use the logical operator with a statement that doesn't return a "True" or "False" (I'm assuming $feature.USER_C_UNI_VLAN_ID is the "VLAN ID" in your table). If I'm understanding what you're trying to do, you should add in two additional Arcade field elements to your popup for the other two records. The code would look something like this var feat = First(Filter($layer, "OBJECTID = 297"));
return {
type: "fields",
title: `Record ${feat.OBJECTID}`,
fieldInfos: [
{ fieldName: "Service Type" },
{ fieldName: "Service Medium" },
{ fieldName: "VLAND ID" }
],
attributes:
{
"Service Type": feat["Service_Type"],
"Service Medium": feat["Service_Medium"],
"VLAND ID": feat["USER_C_UNI_VLAN_ID"]
}
};
... View more
10-04-2024
01:03 PM
|
2
|
0
|
2486
|
|
POST
|
With some more testing, this would check if the geometry changed, returning "Equal" if I just changed an attribute and "Not Equal" when I moved a vertex. if (Area($originalFeature) != Area($feature)){
return 'Not equal';
} else {
return 'Equal';
} when
... View more
10-02-2024
10:00 AM
|
0
|
0
|
1117
|
|
POST
|
What happens if you compare the geometries of the two features? if (Geometry($originalFeature) != Geometry($feature)) {
... View more
10-02-2024
07:08 AM
|
0
|
2
|
1132
|
|
POST
|
There are a couple of things going on. The FeatureSet "x" from the first line doesn't contain a "count" field to sort in line 3. Use the "total" field in line 3 Even though DSC in line 3 works, officially you should use DESC The chartValue keys have to be strings, not numbers (although that doesn't seem to be documented anywhere). In my testing dataset, the Year field is numeric Give this a try var x = GroupBy($layer, 'Year', { name: 'total', expression: 'units', statistic: 'SUM' });
var sorted = OrderBy(x, 'total DESC')
var chartValues = {}
var chartNames = []
for(var f in sorted) {
console(f.year)
chartValues[`${f.year}`] = f.total
Push(chartNames, f.year)
}
... View more
10-01-2024
08:35 AM
|
0
|
0
|
1438
|
|
POST
|
If you have a long list of agencies to check, this might be a better way. You can modify the array of agencies easier than making a long When function var agencies = ["DDOT", "PEMA", "CFSA"];
var output = "undefined";
for (var j in agencies) {
if (Find(agencies[j], $feature.groupNames) != -1) output = agencies[j];
}
return output
... View more
09-30-2024
07:54 AM
|
0
|
0
|
2230
|
|
POST
|
If your goal is to get the agency name for each feature rather than finding the ones that are "DDOT", then you should use this. When(Find('DDOT', $feature.groupNames) != -1, 'DDOT',
Find('DPW', $feature.groupNames) != -1, 'DPW',
Find("CFSA", $feature.groupNames) != -1, 'CFSA',
// add all the other agency names you're looking for
'undefined')
... View more
09-30-2024
07:31 AM
|
0
|
1
|
2239
|
|
POST
|
Is that field in a domain? If so, you'll need to use the domain code or the DomainName function var level = DomainName($datapoint, "level_of_impact");
var lOI = When(
level == "Critical", "#e01d1d",
level == "High", "#ff7300",
level == "Medium", "#73b2ff",
"#ecf229"
);
... View more
09-27-2024
07:22 AM
|
1
|
1
|
1317
|
|
POST
|
What you can do is use Arcade to return unique categories, which would look like this if (IsEmpty($feature.License_Expiration)) return 'No Expiration Date'
var span = DateDiff(Date($feature.License_Expiration), Now(), 'days')
When (span < 0, 'Expired',
span < 120, 'Nearing expiration',
'Not expired') And you would then set the outline colors in the Styles dialog
... View more
09-25-2024
08:33 AM
|
1
|
1
|
1175
|
|
POST
|
With some more testing, I found a way to get the result faster, using the GroupBy function. Give this a try var portalItem = "RanDOmP0rta1iDNUm85r";
var thisPortal = Portal("https://myserver.mydomain.com/portal");
var inspections = FeatureSetByPortalItem(
thisPortal,
portalItem,
58,
["InspectionId", "PrjStartDate", "ShopDescription", "DistrictDescription"]
);
GroupBy(
inspections,
"OBJECTID",
[
{ name: "InspectionID", expression: "1", statistic: "MAX" },
{ name: "ShopDescription", expression: "1", statistic: "MAX" },
{ name: "District", expression: "DistrictDescription", statistic: "MAX" },
{
name: "CycleYear",
expression: "MOD(EXTRACT(YEAR FROM PrjStartDate), 5) + 1",
statistic: "MAX"
}
]
);
... View more
09-20-2024
01:03 PM
|
1
|
1
|
1803
|
|
POST
|
It's because you set the InspectionID field in the dictionary as an esriFieldTypeOID. In testing with my data, if I use an InspectionID field that has unique values, I get the correct number of records. If I use a field without unique records, it only returns the number of unique records. Changing the field type to esriFieldTypeInteger returns all the records, regardless of whether the value are unique or not. var cycleYears = {
'fields': [{'name':'InspectionID', 'type': 'esriFieldTypeInteger'},
{'name':'ShopDescription', 'type': 'esriFieldTypeString'},
{'name':'District', 'type': 'esriFieldTypeString'},
{'name':'CycleYear','type': 'esriFieldTypeDouble'}],
'geometryType': '',
'features': []
}
... View more
09-20-2024
10:12 AM
|
1
|
0
|
1817
|
| 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 |
Online
|
| Date Last Visited |
53 seconds ago
|