|
POST
|
I think what the sample is doing is showing how to do different things with the layers. If you click the gear icon on a layer, the "Labels" button will show or hide the labels and the "unique" button will symbolize the data with a simple renderer or a unique-value renderer. The labelExpression seems to be a mistake. If you replace that line with labelExpressionInfo: {
expression: "$feature.assetgroup"
} the labels show unique information If you find errors in the sample code, it's more helpful to give feedback directly to Esri about this. To do that, scroll to the bottom of the page and click the thumbs down icon. This will bring up a dialog to send a message to the team.
... View more
01-13-2025
01:01 PM
|
0
|
3
|
1541
|
|
POST
|
That should work if you're using the proper color codes. This code show an example of changing the background color using a When function and the text color using an Iif function var theDate = Text($datapoint.FishDate, 'MMMM D, Y');
var bgColor = When(theDate == 'June 6, 2023', '#FF0000',
theDate == 'June 7, 2023', '#FFFF00',
theDate == '', '#ffffff',
'#e2e2e2');
var textColor = Iif(theDate == 'June 6, 2023', '#ffffff', '#000000');
return {
textColor: textColor,
backgroundColor: bgColor
}
... View more
01-10-2025
07:32 AM
|
0
|
0
|
834
|
|
POST
|
Esri maintains a Github repository of Dashboard samples, one of which shows how to combine multiple data sources into a single chart.
... View more
01-07-2025
06:54 AM
|
0
|
0
|
662
|
|
POST
|
Looping through a dictionary is always done alphabetically, not in the order that you create it. One way to get around that is to modify the dictionary keys to ensure they're in alphabetical order, then removing that part of the key. var label_array = [$feature.SHORT_NAME]
var counts = {
"A 0-29": $feature.S,
"B 30-59": $feature.M,
"C 60-99": $feature.L,
"D 100-149": $feature.XL,
"E 150+": $feature.XXL
};
for (var c in counts) {
if (counts[c] > 0) {
Push(label_array, `\t${Mid(c, 2)}: ${counts[c]}`);
}
}
return Concatenate(label_array, "\n");
... View more
01-06-2025
07:27 AM
|
1
|
0
|
2891
|
|
POST
|
Which version of Portal are you using? $userInput was available as of Arcade version 1.26 and according to the Version matrix, only ArcGIS Enterprise portal 11.4 supports that version.
... View more
01-03-2025
06:04 AM
|
1
|
1
|
1585
|
|
POST
|
The Arcade samples use the "text/plain" attribute generally with inline scripts and the "text/javascript" attribute with external .js files. Does this fix your parsing error? <script type="text/plain" id="serviceTag">
if($feature.open){
return "https://myURL/order-green.png"
}else {
return "https://myURL/order-red.png"
}
</script>
... View more
01-02-2025
08:03 AM
|
0
|
1
|
1543
|
|
POST
|
I don't see this happening in any of the browsers I've tried (Firefox, Chrome, or Edge)
... View more
12-26-2024
01:43 PM
|
2
|
0
|
1512
|
|
POST
|
The Visualization profile only has access to the Core and Geometry bundles, not the Data access bundle, which includes all the FeatureSet functions. All FeatureSet functions are not included in rendering profiles, such as visualization and labeling, because they require querying data from a server or database. Allowing these functions in rendering profiles would severely hinder the performance of apps executing the expression. For example, if an expression were to access data with one query within the visualization profile of a layer with 1000 features, then the expression's execution context would need to make 1,000 queries in behalf of the user. It also doesn't have access to the $map variable.
... View more
12-20-2024
07:43 AM
|
2
|
1
|
1202
|
|
POST
|
For the advanced formatting code, you'll substitute $datapoint for $feature. You'll have to create a variable for your calculation that you will use in the return section. var cost;
// combines data from field 1 and 2 into a single var
var orig_asptotcost = IIF($datapoint.PR_ASPTOTCOST > 0, $datapoint.PR_ASPTOTCOST, $datapoint.PR_ORIGTOTCOST)
// when the below criteria are met, orig_asptotcost is displayed
if($datapoint.PR_Status == '01. Submitted – Pending Review/Scoring' || $datapoint.PR_Status == '02. Scored' || $datapoint.PR_Status == '03. Advanced SW Planning'){
cost = round(orig_asptotcost, 2);
//when the below criteria are met, data from PR_P6TOTCOST is displayed
} else if ($datapoint.PR_Status == '04. Design' || $datapoint.PR_Status == '05. Construction') {
cost = round($feature.PR_P6TOTCOST, 2);
//when the below criteria are met, data from PR_EBSTOTCOST is displayed
} else if ($datapoint.PR_Status == '07. Completed'){
cost = round($datapoint.PR_EBSTOTCOST, 2);
}
return {
//textColor:'',
//backgroundColor:'',
//topText: '',
//topTextColor: '',
//topTextOutlineColor: '',
//topTextMaxSize: 'medium',
middleText: cost,
middleTextColor: '',
middleTextOutlineColor: '',
middleTextMaxSize: 'large',
//bottomText: '',
//bottomTextColor: '',
//bottomTextOutlineColor: '',
//bottomTextMaxSize: 'medium',
//iconName:'',
//iconAlign:'left',
//iconColor:'',
//iconOutlineColor:'',
//noValue:false,
//attributes: {
// attribute1: '',
// attribute2: ''
// }
} Since orig_asptotcost is only needed in the first if evaluation, you could move that calculation within that section. var cost;
// when the below criteria are met, orig_asptotcost is displayed
if($datapoint.PR_Status == '01. Submitted – Pending Review/Scoring' || $datapoint.PR_Status == '02. Scored' || $datapoint.PR_Status == '03. Advanced SW Planning'){
cost = round(IIF($datapoint.PR_ASPTOTCOST > 0, $datapoint.PR_ASPTOTCOST, $datapoint.PR_ORIGTOTCOST), 2);
//etc
... View more
12-19-2024
07:34 AM
|
0
|
1
|
1525
|
|
POST
|
You can use "else if" in a if/else block, but I do agree that using When is a better solution.
... View more
12-16-2024
06:46 AM
|
0
|
2
|
4170
|
|
POST
|
You were missing a extra "=" on line 3 $feature.PRE_DIR == NULL if(($feature.STR_TYPE == "AV") && ($feature.PRE_DIR != NULL)){
return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20ave%20"+$feature.PRE_DIR+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20ave%20"+$feature.PRE_DIR;}
else if (($feature.STR_TYPE == "AV") && ($feature.PRE_DIR == NULL)){
return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20ave"+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20ave";}
else if (($feature.STR_TYPE != "AV") && ($feature.PRE_DIR != NULL)){
return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20+"+$feature.PRE_TYPE+"%20"+$feature.PRE_DIR+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20"$feature.PRE_TYPE+"%20"+$feature.PRE_DIR;}
else if (($feature.STR_TYPE != "AV") && ($feature.PRE_DIR = NULL)){
return "http://fileshare.napoleonohio.com/vfolder_frame.ghp?vfolder=/Address%20Files/"+$feature.STR_NAME+"%20+"+$feature.PRE_TYPE+"%20"+"/"+$feature.STR_NUM+"%20"+$feature.STR_NAME+"%20"$feature.PRE_TYPE+;}
... View more
12-16-2024
06:44 AM
|
1
|
0
|
4172
|
|
POST
|
I've lost the ability to edit a post. This happened last year...is it the same problem?
... View more
12-16-2024
06:21 AM
|
0
|
2
|
1180
|
|
POST
|
When posting code, please us the "Insert/Edit code sample" button. It's much easier to read and analyze rather that trying to replicate it from an image
... View more
12-16-2024
06:17 AM
|
1
|
0
|
4187
|
|
POST
|
You can use this code to get the related features using just FeatureSetbyName var value = $feature.theCommonField;
var fs = FeatureSetByName($map, "GIS.SDE.tbl_Valve_FieldPressure");
var latest_survey = First(OrderBy(Filter(fs, "fieldName = @value"), "created_date DESC"));
... View more
12-13-2024
01:36 PM
|
1
|
1
|
1416
|
|
POST
|
The solution @UmaHarano provides is a good one. If I do another update on the code, I'll use that. I was able to resolve my issue with my code by specifying the Binding class's UpdateSourceTrigger property. The default value for the Text property is LostFocus, so I had to specify it as PropertyChanged. <TextBox x:Name="MultistageCountValue"
Text="{Binding MultistageCount, UpdateSourceTrigger=PropertyChanged}"
PreviewTextInput="NumericTextBox_PreviewTextInput"
TextChanged="MultistageCountValue_TextChanged"/>
... View more
12-10-2024
02:31 PM
|
0
|
0
|
1473
|
| 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 |
4 weeks ago
|