|
POST
|
What kind of table are you using this in? Is this in a Data Expression for a Dashboard?
... View more
12-10-2024
06:55 AM
|
0
|
1
|
3298
|
|
POST
|
You can use these in Arcade functions (Distinct, Filter, GroupBy, etc)
... View more
12-06-2024
07:17 AM
|
0
|
0
|
1732
|
|
POST
|
You can simplify your code even further, getting rid of that loop and utilizing the loop in line 3 to populate the chartNames and chartColors arrays.
... View more
12-05-2024
12:58 PM
|
1
|
0
|
1544
|
|
POST
|
When you loop through the dictionary in line 24, the variable n is the key name. You just need to modify your loop like this for (var n in decades_dict) {
//Make chart monochromatic
Push(chartColors, [6,47,120])
Push(chartNames, n)
}
... View more
12-05-2024
11:53 AM
|
1
|
0
|
1550
|
|
POST
|
Give this a try var topoText = When(IsEmpty($datapoint["Topo"]), '', `<a href="${$datapoint["Topo"]}" target="blank">Download Topo Map</a>`)
var aerialText = When(IsEmpty($datapoint["Aerial"]), '', `<a href="${$datapoint["Aerial"]}" target="blank">Download Aerial Map</a>`)
return {
cells: {
TreatyImp: {
displayText : $datapoint.TreatyImp,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
Topo: {
displayText : topoText,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
Aerial: {
displayText : aerialText,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
}
}
... View more
12-04-2024
01:50 PM
|
2
|
1
|
1934
|
|
POST
|
Thanks for your reply. I'll dig into this. Please note that you're using a beta version in your testing. When I opened it, it couldn't run since it was targeting ArcGIS Pro 3.5
... View more
12-04-2024
12:07 PM
|
0
|
1
|
1530
|
|
POST
|
I had omitted the Expects function. Give this a try var high = false;
var medium = false;
var low = false;
Expects($feature, '*'); // or you can list out just the field names you need
for (var i = 1; i <= 19; i++) {
var fieldName = `Priority_${i}`
if ($feature[fieldName] == 'High') high = true;
if ($feature[fieldName] == 'Medium') medium = true;
if ($feature[fieldName] == 'Low') low = true;
}
When(high, 'High',
medium, 'Medium',
low, 'Low',
'No Maintenance Needed')
... View more
12-04-2024
07:41 AM
|
0
|
0
|
2912
|
|
POST
|
If your field names are indeed like that, this should work var high = false;
var medium = false;
var low = false;
for (var i = 1; i <= 19; i++) {
var fieldName = `Priority_${i}`
if ($feature[fieldName] == 'High') high = true;
if ($feature[fieldName] == 'Medium') medium = true;
if ($feature[fieldName] == 'Low') low = true;
}
When(high, 'High',
medium, 'Medium',
low, 'Low',
'No Maintenance Needed')
... View more
12-03-2024
02:56 PM
|
2
|
2
|
2952
|
|
POST
|
Usually links get sanitized with a simple return, which is why you have to use an Arcade element with popups for html elements.
... View more
12-03-2024
02:38 PM
|
0
|
1
|
1824
|
|
POST
|
Urgh...I'm not concentrating hard enough today push(output, '<a href="' + f.URL + '">' + dsource + '</a>');
... View more
12-03-2024
01:35 PM
|
0
|
3
|
1840
|
|
POST
|
OK, I see what's going on. I overlooked the fact that this is in an expression where you're already using backticks. Try this instead push(output, '<a href="' + f.URL + '">${dsource}</a>');
... View more
12-03-2024
11:14 AM
|
0
|
6
|
1852
|
|
POST
|
You can use the FeatureSetByRelationshipName function to get the related records for your feature, then use the GroupBy function on that FeatureSet to get the sum of the values in a particular field. That would look something like this: var relatedFeatures = FeatureSetByRelationshipName($feature, 'the relationship name', ['your field'], false)
var summary = GroupBy(relatedFeatures, '1', { name: 'Sum', expression: 'your field', statistic: 'Sum' });
return First(summary).Sum
... View more
12-03-2024
10:36 AM
|
0
|
1
|
1259
|
|
POST
|
My apologies, I left off the closing parenthesis push(output, `<a href="${f.URL}">${dsource}</a>`);
... View more
12-03-2024
10:36 AM
|
0
|
8
|
4068
|
|
POST
|
When posting code, please use the "Insert/Edit code sample" button. It makes it easier to read and refer to line numbers. You're pushing a FeatureSet into the output array. You have to loop through the records in that FeatureSet and push each link into it. for (var i in arr) {
var dsource = arr[i]
var pub = Filter(table, "DataSources_ID = @dsource");
// var link = <a href="{First(pub).URL}">{dsource}</a>
// push(output, pub)
for (var f in pub) {
push(output, `<a href="${f.URL}">${dsource}</a>`
}
}
... View more
12-03-2024
07:54 AM
|
0
|
10
|
4092
|
|
POST
|
I have built an add-in to select features from a layer. There are two TextBoxes on the panel, MultiStageCountValue, which signifies the number of features to be selected, and MultistagePercentageValue, which signifies the percentage of features to be selected. If the user types in the number of features, the code-behind will calculate the percentage of features, updating the MultistagePercentageValue textbox. If the user types in a value for the percentage of features, the code-behind will update the value for the MultiStageCountValue textbox. It also recalculates the actual percentage, since I only allow for integers to be typed into either field (for example, 33% of 76 features is 25 features, which is actually 32.89% of the features) This is the code for each textbox in the xaml file. I use the value from the MultiStageCountValue textbox in a query in my ViewModel code, using the Binding variable MultistageCount. <TextBox x:Name="MultistageCountValue"
Text="{Binding MultistageCount}"
PreviewTextInput="NumericTextBox_PreviewTextInput"
TextChanged="MultistageCountValue_TextChanged"/>
<TextBox x:Name="MultistagePercentageValue"
Text="{Binding MultistagePercentage}"
TextChanged="MultistageCountValue_TextChanged"
PreviewTextInput="NumericTextBox_PreviewTextInput"
LostFocus="MultistagePercentageValue_LostFocus"/> I use the same code for the TextChanged event for both textboxes, which does some validation and updates the MultistagePercentageValue textbox when I change the MultiStageCountValue textbox value. private void MultistageCountValue_TextChanged(object sender, TextChangedEventArgs e)
{
TextBox textbox = sender as TextBox;
if (textbox.Name == "MultistageCountValue")
{
MultistagePercentageValue.Text = ((double)int.Parse(textbox.Text) / NumberofFeatures * 100).ToString("F");
}
// other validation code
} I have code for when the MultistagePercentageValue textbox loses focus so that the MultiStageCountValue textbox only gets updated when the user is done typing in the percentage private void MultistagePercentageValue_LostFocus(object sender, RoutedEventArgs e)
{
TextBox textbox = sender as TextBox;
MultistageCountValue.Text = (float.Parse(textbox.Text) / 100 * NumberofFeatures).ToString("F0");
} In my testing, the MultistageCount value gets updated correctly if I type in the MultiStageCountValue textbox or when I type in the MultistagePercentageValue TextBox and then click in the MultiStageCountValue textbox. However, if I type in the MultistagePercentageValue TextBox and tab out of the text box, while the MultiStageCountValue textbox will get updated, the MultistageCount value does not get updated and the query uses the previous value. Why doesn't MultistageCount get updated when the focus is lost by tabbing out of the textbox versus clicking outside it?
... View more
12-02-2024
01:57 PM
|
0
|
4
|
1575
|
| 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
|