POST
|
Unfortunately, you can't use label formatting tags in Arcade.
... View more
12 hours ago
|
0
|
0
|
32
|
POST
|
You'll have to use an Arcade element instead of a chart. This uses the "media" popupElement in the return. Here's an example with your code that creates a basic bar chart var state = $feature.AALRegion;
var portal = Portal('https://www.arcgis.com');
var fields = [
'OBJECTID',
'Region',
'gridcode',
'Hectares'
];
var fs = FeatureSetByPortalItem(
portal,
'7369e87b3b104eae8c18507261184083', // FeatureService ID that you want to grab fields from.
0, // Sublayer index, usually 0.
fields, // Array of fields to grab from the FeatureService.
False // Include geometry?
);
var final = GroupBy(Filter(fs,"Region = @state"),'gridcode',
{
name: 'sumhec',
expression: 'Hectares',
statistic: 'SUM'
},
);
var Values = {};
var barNames = [];
for (var i in final) {
Values[Text(i.gridcode)] = i.sumhec; //you have to use a Text string for the Value keys. It doesn't work with numbers
Push(barNames, i.gridcode)
}
return {
type: "media",
attributes:Values,
mediaInfos:[{
type: "barchart",
title: `Sum of ${state}`,
value: {
fields: barNames
}
}]
}
... View more
yesterday
|
0
|
0
|
22
|
POST
|
The dictionary contained the field "ArrivalTime" but you were assigning 0 to "Arrival_Time". for (var t in Length_Canada) {
combinedDict.features[i++] = {
attributes: {
Shape_Length: t["Shape__Length"],
ArrivalTime: 0
},
geometry: Geometry(t)
};
}
... View more
Tuesday
|
0
|
0
|
42
|
POST
|
Have you used @JosephRhodes2's suggestion to use console messages to check your variables at various steps?
... View more
a week ago
|
0
|
1
|
85
|
POST
|
In Line 10 of your first post and line 20 in your second post, you're using Top to get the first record, but Top returns a FeatureSet, not a Feature. You have to use First instead to use that feature in the next line. Try this (with a couple of other minor modifications) // Define a Featureset (status) from the layer "Cyanobacteria_Public View" in the $map
// that contains the attribute ['cyano_risk_tier']
var status = FeatureSetByName($map, "Cyanobacteria_Public View");
// Define a variable (risk) to store the value we want
// Get the value by Intersecting the pond polygon location
// with the FeatureSet "Cyano Ponds Public View", or status
// var risk = Top(OrderBy(Intersects(status, Buffer($feature, 30, "meters")), 'fluorometry_date DESC'), 1);
// Not sure if this works
// Instead, try to match by CCC GIS ID
var CCC_GIS_ID = $feature.CCC_GIS_ID;
//var IDS = "CCC_GIS_ID = '" + CCC_GIS_ID + "'";
var RelatedReads = Filter(status, "CCC_GIS_ID = @ccc_GIS_ID");
//var numrelreads = count(RelatedReads);
if (Count(RelatedReads) == 0) return "No updated Information";
var LastSampleDate = First(OrderBy(RelatedReads, "fluorometry_date DESC"));
var edit_datetime = Date(LastSampleDate);
var now_datetime = Now();
var days_dif = DateDiff(now_datetime, edit_datetime, "days");
if (days_dif <= 30) return status['cyano_risk_tier'];
return "No updated Information";
... View more
a week ago
|
0
|
3
|
129
|
POST
|
You had a couple of mistakes (missing commas and an errant return) var contest = Decode(f["Contest_title"],"President of the United States (REP)","A",
"United States Senator (REP)", "C",
"Attorney General (REP)", "E",
"Auditor General (REP)", "G",
"State Treasurer (REP)", "I",
"Representative in Congress -13th District (REP)", "K",
"Representative in the General Assembly -78th District (REP)", "O",
"Delegate to the Republican National Convention (REP)" , "M",
"Alternate Delegate to the Republican National Convention (REP)", "P",
"Republican Committee Person - Bedford Borough West (REP)", "Q",
"Republican Committee Person - Bedford Township 1 (REP)", "R",
"Republican Committee Person - Bedford Township 2 (REP)", "S",
"Republican Committee Person - Everett Borough (REP)", "T",
"Republican Committee Person - Hopewell Township (REP)", "U",
"Republican Committee Person - King Township (REP)", "V",
"Republican Committee Person - West Providence Township (REP)", "W",
"Republican Committee Person - West St. Clair Township (REP)", "X",
"Republican Committee Person - Woodbury Township (REP)", "Y",
"President of the United States (DEM)", "B",
"United States Senator (DEM)", "D",
"Attorney General (DEM)", "F",
"Auditor General (DEM)", "H",
"State Treasurer (DEM)", "J",
"Representative in Congress -13th District (DEM)", "L",
"Delegate to the Democratic National Convention (DEM)", "N",
"Unsatisfactory");
... View more
a week ago
|
0
|
2
|
138
|
POST
|
With a "return" in each of the if statements, the code will short-circuit and return a single letter (or "Unsatisfactory") for the first feature. You'll want to use the Decode function to return a variable for that logic to be used later. Here, I'm just making a guess in this code without seeing your data and what you're trying to accomplish. It's also untested, so it might need modification. var portal = Portal('https://.maps.arcgis.com')
var fs = FeatureSetByPortalItem(
portal,
'155af3e091404240acd2904e34a07bf6',
0,
['Contest_title'],
false
);
// Create empty array for features and feat object
var features = [];
var feat;
for (var f in fs) {
var contest = Decode(f["Contest_title"],"President of the United States (REP)","A",
"United States Senator (REP)", "C",
"Attorney General (REP)", "E",
//the rest of the options
"Delegate to the Democratic National Convention (DEM)", "N",
"Unsatisfactory");
feat = {
attributes: {
Contest_ID: contest,
},
};
Push(features, feat);
}
var choicesDict = {
'fields': [
{ 'name': 'Contest_ID', 'type': 'esriFieldTypeString'}],
'geometryType': '',
'features': features
};
// Convert dictionary to featureSet.
var fs_dict = FeatureSet(Text(choicesDict));
// Return featureset after grouping by hazard types.
return GroupBy(fs_dict, ['Contest_ID'],
[{ name: 'Contest_ID', expression: 'Contest_ID', statistic: 'MAX' }]); .
... View more
a week ago
|
0
|
6
|
154
|
POST
|
Querying dates in SQL can be picky, especially if there is time involved. In some testing I was doing on my data, if I queried it using "Date = '07/10/2016'", it would return 0 features. If I queried using "Date > '07/10/2016' AND DATE1 <= '07/11/2016'", it would return 29 records. The query "cast(Date1 as date) = cast('7/10/2016' as date)" also returned 29 records. However, there are 36 records on that date, since I have several records after 8 pm ET (which is after midnight on the next day in UTC). This query finally returned all 36 records var offset = -TimeZoneOffset(Now()); //returns time zone offset in milliseconds. Use - for Western Hemisphere
var startDate = DateAdd(Date(2016,06,10), offset, 'milliseconds');
var endDate = DateAdd(startDate, 1, 'day');
var filtered = Filter(fs, "Date1 > @startDate AND DATE1 <= @endDate");
return (Orderby(filtered, 'Date1 ASC'));
... View more
2 weeks ago
|
0
|
0
|
57
|
POST
|
I had overlooked that the Geometry bundle is not available in the Dashboard list formatting profile, most likely for performance gains. I'm looking into a way to add that to your data as you load it into Dashboard
... View more
2 weeks ago
|
0
|
2
|
196
|
POST
|
Take a look at the page on template literals. The two examples I provided give the same output.
... View more
2 weeks ago
|
1
|
4
|
206
|
POST
|
If you use regular quotes, then the line would like this var output = 'x: ' + thePoint.x + ', y: ' + thePoint.y
... View more
2 weeks ago
|
0
|
6
|
222
|
POST
|
My code uses template literals , which uses the back tick (`) instead of the regular quote (').
... View more
2 weeks ago
|
0
|
8
|
224
|
POST
|
You can use the Centroid function to get the center point for a polygon. var thePoint = Centroid(Geometry($feature));
var output = `x: ${thePoint.x}, y: ${thePoint.y}`
... View more
2 weeks ago
|
1
|
10
|
237
|
POST
|
You can check the status of ArcGIS Hub at the Health Dashboard and report any issues.
... View more
2 weeks ago
|
0
|
0
|
184
|
Title | Kudos | Posted |
---|---|---|
1 | 04-10-2023 07:07 AM | |
1 | 07-22-2021 02:14 PM | |
1 | 2 weeks ago | |
1 | 2 weeks ago | |
1 | 12-15-2023 08:33 AM |
Online Status |
Offline
|
Date Last Visited |
16 hours ago
|