|
POST
|
You can use an Arcade element to do this. In this example I am testing whether a feature has the attribute "Fish and Benthic" (line 14). This field has a domain, so I have to get the Domain Name ( line 12). If the feature does have that attribute, I want the display to contain the five fields in the line 16. Otherwise, it will contain the three fields in line 22. var fields = Schema($feature).fields;
var attributes = {};
var fieldInfos = [];
function fieldTest(fieldList, fieldName, fieldAlias) {
if (Includes(fieldList, fieldAlias)) {
attributes[fieldalias] = $feature[fieldName];
Push(fieldInfos, { fieldName: fieldAlias });
}
}
var code = DomainName($feature, "Survey");
for (var i in fields) {
if (code == "Fish and Benthic")
fieldTest(
["Site ID", "Fish Status", "Fish Date", "Benthic Status", "Benthic Date"], //the list of fields you'd like if the feature has this attribute
fields[i].name,
fields[i].Alias
);
else
fieldTest(
["Site ID", "Fish Status", "Fish Date"], //the list of fields you'd like if the feature doesn't have that attribute
fields[i].name,
fields[i].alias
);
}
return { type: "fields", fieldInfos: fieldInfos, attributes: attributes }; These are what the two popups look like
... View more
09-10-2025
12:02 PM
|
2
|
0
|
496
|
|
POST
|
Unfortunately, this is not something that can be directly done through Advanced formatting in the Values tab. This is because the Arcade code in there only works with individual rows and not the entire dataset. You would have to create an additional field, which can be done with Arcade in a data expression that powers the table. Then you can use the value for the field to highlight the cell with Advanced formatting with Arcade. This code adds the extra UniqueCount column to your dataset. It does run slowly, but I don't know if that was due to network issues we seem to be having today. I'll have to do some more testing to see if I can make it more efficient. var fs = FeatureSetByPortalItem(
Portal("your Portal"),
"yourItem",
0,
false
);
var uniqueField = "your field";
var grouped = GroupBy(
fs,
uniqueField,
{ name: "Count", expression: "1", statistic: "COUNT" }
);
var fields = Schema(fs)["fields"];
Push(fields, { name: "UniqueCount", type: "esriFieldTypeSmallInteger" });
var temp_dict = {
fields: fields,
geometryType: "",
features: []
};
for (var f in fs) {
var attrs = {};
var value;
for (var attr in f) {
attrs[attr] = f[attr];
if (attr == uniqueField) {
value = f[attr];
}
}
var sql = `${uniqueField} = ${value}`;
//var sql = `${uniqueField} = '${value}'` // if uniqueField is a text field
attrs.UniqueCount = First(Filter(grouped, sql)).Count;
Push(temp_dict["features"], { attributes: attrs });
}
return FeatureSet(temp_dict); You don't need to add the UniqueCount field to the Value fields when setting up the table, but you'll use that field in the Advanced formatting tab. In this example, since all the Depth_ft values in my test table have multiple instances, I'm highlighting those that have more than 10 instances in line 1 var bgColor = iif ($datapoint.UniqueCount > 10, '#ff0000', '#ffffff')
return {
cells: {
FIELD_ID: {
displayText : Text($datapoint.FIELD_ID),
textColor: '',
backgroundColor: '',
textAlign: 'right',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
LAT: {
displayText : Text($datapoint.LAT),
textColor: '',
backgroundColor: '',
textAlign: 'right',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
LONG: {
displayText : Text($datapoint.LONG),
textColor: '',
backgroundColor: '',
textAlign: 'right',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
DEPTH_FT: {
displayText : Text($datapoint.DEPTH_FT),
textColor: '',
backgroundColor: bgColor,
textAlign: 'right',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
}
} That yields this table
... View more
09-08-2025
01:00 PM
|
0
|
0
|
244
|
|
POST
|
See these settings in the App setting section of the Field Map Designer Set map behavior when collecting new features Determine whether manual location can be used for feature collection
... View more
09-04-2025
05:12 AM
|
0
|
8
|
859
|
|
POST
|
That error is usually associated with a problem in the Filter function sql statement. Check your fields and if those field names and values are valid. You can make the sql statement easier to read using variable substitution (see the documentation). You don't have to worry about quotes using this syntax var student = f["nbid2"];
var sdate = ToUTC(f["Max_Date"]);
var sdate_local = f["Max_Date"];
var sql = "nextrecheckdate = @sdate AND nbid2 = @student";
... View more
08-27-2025
08:39 AM
|
4
|
1
|
484
|
|
POST
|
Glad to point you in the right direction! Don't forget to click the "Accept as Solution" button
... View more
08-26-2025
12:07 PM
|
0
|
0
|
269
|
|
POST
|
Glad to point you in the right direction! Don't forget to click the "Accept as Solution" button
... View more
08-26-2025
12:06 PM
|
0
|
0
|
381
|
|
POST
|
This technical support document explains how you can report issues with the Geocoder, basemaps, or routing services.
... View more
08-26-2025
07:16 AM
|
1
|
2
|
463
|
|
POST
|
This technical support document explains how you can report issues with the Geocoder, basemaps, or routing services.
... View more
08-26-2025
06:23 AM
|
0
|
2
|
324
|
|
POST
|
This appears to be working in Developer Edition v1.18
... View more
08-25-2025
01:34 PM
|
1
|
0
|
304
|
|
DOC
|
@AlexWolf1 You can do that by clicking the "Interact with a Map widget" option (1), clicking on the map under "Specify which layers will be displayed for each map" (2), turn on "Customize layers" (3), and uncheck the layers you don't want to show (4)
... View more
08-21-2025
11:57 AM
|
0
|
0
|
2367
|
|
POST
|
After giving this a little thought, there's an even faster way to do this. Cycling through each set of lines in each service area polygon to write them to a dictionary is pretty inefficient. Instead, this version unions each of the service areas into a single polygon to use in a single Intersects function. And if there is only one polygon in the service area, it skips that step. //Define the Enterprise portal connection
var myportal = Portal("https://samplesite.net/portal");
// Get the line layer: UN - Sewer Lines
var SewerLines = FeatureSetByPortalItem(
myportal,
"2c08361d8abe4308afba3d25c857a11c",
3,
["*"],
true
);
// Get the polygon layer: Separated Service Areas,
//filtered for Core Service Area feature only
var CoreSvcAreas = Filter(
FeatureSetByPortalItem(
myportal,
"41c17045b4cf4359a8237db163fe82a6",
0,
["*"],
true
),
"ServiceAreaName = 'RVSS Core Service Area'"
);
// return the intersection if there's only one service area
if (Count(CoreSvcAreas) == 1) return Intersects(SewerLines, First(CoreSvcAreas));
// otherwise, union the service areas together and return the intersection
var areas = [];
for (var area in CoreSvcAreas) {
Push(areas, area)
}
return Intersects(SewerLines, Union(areas));
... View more
08-21-2025
11:37 AM
|
1
|
0
|
747
|
|
POST
|
I had edited my first response to explain why you were getting that error. In addition, there was another issue with your code. A data expression has to return a FeatureSet, but you were returning an array. You would have to convert the array of lines into a FeatureSet to use it in the dashboard. This code should work when a service area is comprised of multiple polygons //Define the Enterprise portal connection
var myportal = Portal("https://samplesite.net/portal");
// Get the line layer: UN - Sewer Lines
var SewerLines = FeatureSetByPortalItem(
myportal,
"2c08361d8abe4308afba3d25c857a11c",
3,
["*"],
true
);
// Get the polygon layer: Separated Service Areas,
//filtered for Core Service Area feature only
var CoreSvcAreas = Filter(
FeatureSetByPortalItem(
myportal,
"41c17045b4cf4359a8237db163fe82a6",
0,
["*"],
true
),
"ServiceAreaName = 'RVSS Core Service Area'"
);
var dict = {
fields: Schema(SewerLines)["fields"],
geometryType: Schema(SewerLines)["geometryType"],
features: []
};
for (var CoreSvcArea in CoreSvcAreas) {
for (var line in Intersects(SewerLines, CoreSvcArea)) {
var attributes = {};
for (var attr in line) {
attributes[attr] = line[attr];
}
Push(dict["features"], { attributes: attributes });
}
}
return FeatureSet(dict);
... View more
08-21-2025
10:27 AM
|
0
|
2
|
764
|
|
POST
|
Is each of the CoreSvcAreas a single polygon or is it multiple polygons? If it's a single polygon, then you can make this much simpler //Define the Enterprise portal connection
var myportal = Portal("https://samplesite.net/portal");
// Get the line layer: UN - Sewer Lines
var SewerLines = FeatureSetByPortalItem(
myportal,
"2c08361d8abe4308afba3d25c857a11c",
3,
["*"],
true
);
// Get the polygon layer: Separated Service Areas,
// filtered for Core Service Area feature only
// This works only if there is one polygon per service area
var CoreSvcArea = First(
Filter(
FeatureSetByPortalItem(
myportal,
"41c17045b4cf4359a8237db163fe82a6",
0,
["*"],
true
),
"ServiceAreaName = 'RVSS Core Service Area'"
)
);
return Intersects(SewerLines, CoreSvcArea); You were getting that error in the Filter function since you had a syntax wrong. Filter expects an SQL expression (a string) as the second parameter, but you were supplying it a FeatureSet (the result from the Intersects function)
... View more
08-21-2025
09:21 AM
|
1
|
4
|
785
|
|
POST
|
You can find that by clicking on the down arrow in the Details section under the URL
... View more
08-20-2025
05:41 AM
|
1
|
2
|
821
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 2 | a week 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 |
Tuesday
|