|
POST
|
If you have a relationship set up between the two layers, you can use this syntax to get an attribute from the other layer var related = FeatureSetByRelationshipName($feature, 'your relationship name');
if (Count(related) > 0) {
var record = First(related);
return record.theField;
} If not, you can use this syntax to get the other feature. var asset_id = $feature.GUID
var fs = FeatureSetByPortalItem(
Portal('yourPortal'),
'itemId',
0,
['*'],
false
);
var related = First(Filter(fs, "GlobalID = @asset_id"))
if(related != null) return related.theField
... View more
07-17-2024
09:29 AM
|
2
|
0
|
929
|
|
POST
|
You can use GroupBy, getting the count of each attribute in your field, then returning the counts above 1. var fs = FeatureSetByPortalItem(
Portal("https://www.arcgis.com"),
"6200db0b80de4341ae8ee2b62d606e67",
0,
["*"],
true
);
var gb = GroupBy(
fs,
["FLOORCOUNT"],
{ name: "Count", expression: "1", statistic: "COUNT" }
);
Filter(gb, "Count > 1");
... View more
07-17-2024
06:50 AM
|
0
|
1
|
3333
|
|
POST
|
The Filter sql statement is incorrect. You had it correct in your original code. Did you mean to use this? var fsAEO = Filter(fs, "selec = 'Registar AEO'");
... View more
07-12-2024
11:30 AM
|
0
|
0
|
1649
|
|
POST
|
Is it possible that there are extra spaces in the antennae names? Try this to see if it returns "Yes!". IIf(Trim($feature.Name) == "TRM115000.00 NONE", "Yes!", "No")
... View more
07-12-2024
07:02 AM
|
0
|
0
|
1046
|
|
POST
|
Your code works correctly with a sample dataset (with a couple of modification for different fields). I would check if you're getting the expected records from your filter (line 13). // 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
false // include or exclude geometry
);
// Filter AEO records and sort by creation date
var fsAEO = Filter(fs, "FeatureCode = 1000");
console(Count(fsAEO))
var sortedFS = OrderBy(fsAEO, "LASTUPDATE DESC");
// Create a list to store the modified records
var updatedFeatures = [];
// Iterate over the records and modify the date
for (var feature in sortedFS) {
// Obter a data de criação
var creationDate = Date(feature.LASTUPDATE);
// Add 3 days to the date
var newDate = DateAdd(creationDate, 3, "days");
// Create a New Object with the Date Modified
var updatedFeature = {
attributes: { selec: feature.FeatureCode, CreationDate: newDate }
};
// Add the new object to the list
Push(updatedFeatures, updatedFeature);
}
// Create a New FeatureSet with the Modified Records
var updatedFeatureSet = {
fields: [
{ name: "selec", type: "esriFieldTypeString" },
{ name: "CreationDate", type: "esriFieldTypeDate" }
],
geometryType: "",
features: updatedFeatures
};
// Return the Modified FeatureSet
return FeatureSet(updatedFeatureSet);
... View more
07-12-2024
06:49 AM
|
0
|
3
|
1667
|
|
POST
|
You could also use this syntax var DateRec = $feature.DATEAPRECV;
var DateVal = $feature.DATEAPVAL;
var ValDays = DateDiff(DateVal, DateRec, 'Days');
return `${ValDays } ${iif(Abs(ValDays) == 1, 'day', 'days')}`
... View more
07-12-2024
06:07 AM
|
3
|
0
|
1902
|
|
POST
|
You're assigning the dictionary a geometry type, but not using that at all. Try using this var OutputDict = {
fields: [
{ name: "organisation", type: "esriFieldTypeString" },
{ name: "PostcodeSectorAv", type: "esriFieldTypeInteger" },
{ name: "PostcodeSectorCount", type: "esriFieldTypeInteger" },
{ name: "GSS_CODE", type: "esriFieldTypeString" }
],
geometryType: "",
features: []
};
... View more
07-08-2024
06:45 AM
|
0
|
1
|
1027
|
|
POST
|
Yes, that is confusing. The documentation should point to the Dashboard group instead of Databoard data, since other Dashboard profiles do give access to the $datapoint profile variable, which those two functions can utilize.
... View more
06-28-2024
09:24 AM
|
1
|
0
|
1930
|
|
BLOG
|
Is the url correct for the outletcounty example? It ends with "&rivercountry=United%20States&ORrivercountry=United%20States"
... View more
06-27-2024
07:49 AM
|
1
|
0
|
750
|
|
POST
|
What might be happening is the editor uses the first feature in the dataset for the run. If that feature doesn't intersect the "Civic Addresses" data, the variable int will be null. You should test for that return iif(IsEmpty(int), 'No intersecting feature', int.FULL_ADDRESS)
... View more
06-26-2024
10:48 AM
|
0
|
0
|
784
|
|
POST
|
Does the shapefile get created on your drive but isn't added to the map? If so, set the GPExecuteToolFlags enumeration to AddOutputsToMap in the ExecuteToolAsync. await Geoprocessing.ExecuteToolAsync("management.CreateRandomPoints", createPointsParamsValueArray, null, CancelableProgressor.None, GPExecuteToolFlags.AddOutputsToMap); Or does it result in nothing getting created? I return an IGPResult from my geoprocessing tasks to check if they're successful. IGPResult createRandomPointsMessage = await Geoprocessing.ExecuteToolAsync("management.CreateRandomPoints", createPointsParamsValueArray, null, CancelableProgressor.None, GPExecuteToolFlags.AddOutputsToMap);
if (createRandomPointsMessage.IsFailed)
{
System.Diagnostics.Debug.WriteLine("Create random points errors");
}
... View more
06-25-2024
08:22 AM
|
1
|
1
|
1582
|
|
POST
|
Don't forget to click "Accept as Solution" button on the post(s) that answered your question.
... View more
06-25-2024
06:25 AM
|
0
|
0
|
3856
|
|
POST
|
It's an implicit return, so line 46 was the last line of code
... View more
06-25-2024
06:19 AM
|
0
|
0
|
3147
|
|
POST
|
Yes, if I run your logic on my dataset, it does return the expected nested group This is the result of the first GroupBy and this is the result of the second GroupBy
... View more
06-24-2024
02:03 PM
|
0
|
0
|
3204
|
| 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 |
13 hours ago
|