POST
|
Can you provide screen shots of your data? And do you want to show the fields as a comma-separated string ("Field1, field2") or a field list like this?
... View more
15 hours ago
|
0
|
2
|
57
|
POST
|
This solution uses template literals and an implicit return IIf(
$feature.province_code > 59,
`${$feature.both_rate_12}, ${$feature.both_rate_10}`,
`${$feature.both_rate_6}, ${$feature.both_rate_4}`
);
... View more
15 hours ago
|
1
|
4
|
106
|
POST
|
Use the Pow function to raise x to the power of y var D = 0.7;
if (IsEmpty(D)) return null;
return Pow(D - .62, 2.48) * 2.49 * 448.8;
... View more
yesterday
|
2
|
0
|
89
|
POST
|
You are returning a Dictionary, not a FeatureSet. You just need to wrap that Dictionary in the FeatureSet function var capa = FeatureSetByPortalItem(
Portal(""),
"597723f82afb4031a8211a2a993c7688",
0,
["estado"]
);
var total = Count(capa);
var rechazadas = Count(Filter(capa, "estado = 'Rechazada IPEEM/Archivo'"));
var porcentaje = IIf(total == 0, 0, Round(rechazadas / total * 100, 1));
return FeatureSet(
{
fields: [{ name: "porcentaje", type: "esriFieldTypeDouble" }],
geometryType: "",
features: [{ attributes: { porcentaje: porcentaje } }]
}
);
... View more
Monday
|
1
|
0
|
28
|
POST
|
It would help if you provide the code. Are you trying to access fields that don't exist in that particular layer?
... View more
Monday
|
0
|
1
|
95
|
POST
|
There are a few things that need to be fixed in your code. The TypeOf documentation seems to be incorrect. It returns "String" instead of "Text" for text. (line 15) Use "Count" instead of "Length" to return the length of a string (lines 20, 21, and 28) // barcode variable from feature attribute
var barcodeValue = 'BTR7981006';
Console('Barcode Value: ' + barcodeValue);
// Define valid prefixes for Bin
var validPrefixes = [
'BTR75', 'BTR76', 'BTR780', 'BTR781', 'BTR7820', 'BTR7821', 'BTR7831',
'BTR7846', 'BTR7847', 'BTR7848', 'BTR7855', 'BTR7866', 'BTR789', 'BTR790',
'BTR792', 'BTR798'
];
var isValid = false;
// Check if barcode is empty or not a text value
if (IsEmpty(barcodeValue) || TypeOf(barcodeValue) != 'String') {
Console('Failed: Empty or non-text');
isValid = false;
}
// Check if barcode starts with BTR and is 10 characters long
else if (Left(barcodeValue, 3) != 'BTR' || Count(barcodeValue) != 10) {
Console('Failed: Invalid format, BTR=' + Left(barcodeValue, 3) + ', Length=' + Text(Count(barcodeValue)));
isValid = false;
}
// Check if barcode starts with any valid prefix
else {
for (var prefixIndex in validPrefixes) {
var currentPrefix = validPrefixes[prefixIndex];
if (Left(barcodeValue, Count(currentPrefix)) == currentPrefix) {
Console('Passed: Matched prefix ' + currentPrefix);
isValid = true;
break;
}
}
}
// Return validation result
Console('Result: ' + Text(isValid));
return isValid;
... View more
a week ago
|
1
|
2
|
106
|
POST
|
Which version of ArcGIS Pro are you using? According to the documentation, $view was implemented in Arcade 1.30. In the version matrix, this version is available in ArcGIS Pro 3.5 only.
... View more
2 weeks ago
|
0
|
2
|
135
|
POST
|
The advanced formatting tool is designed to format individual values (an indicator result or an item in a list), not calculating values from an entire featureset. What you'll need to do write a data expression for the indicator that will calculate that average. You would use your formatting function in the indicator's advanced formatting section. Your data expression would look something like this var fs = FeatureSetByPortalItem(
Portal("yourPortalUrl"),
"yourItemId",
0,
["DateTimeInit", "DateTimeClosed"],
false
);
var responseTime = 0;
var counter = 0;
for (var f in fs) {
var dateOpened = f.DateTimeInit;
var dateCleared = f.DateTimeClosed;
if (!IsEmpty(dateOpened) && !IsEmpty(dateCleared)) {
responseTime += DateDiff(dateCleared, dateOpened, "seconds");
counter += 1;
}
}
return FeatureSet(
{
fields: [{ name: "Average", type: "esriFieldTypeInteger" }],
features: [{ attributes: { Average: Round(responseTime / counter) } }]
}
);
... View more
2 weeks ago
|
0
|
0
|
243
|
POST
|
Can you post your code using the Insert/Edit code sample button? Trying to decipher code in an image is too difficult, especially when attempting to test your code.
... View more
2 weeks ago
|
0
|
0
|
269
|
POST
|
Glad to help. Please check the "Accept as Solution" box to help others searching on this problem
... View more
2 weeks ago
|
0
|
0
|
125
|
POST
|
There were a couple of things that needed changing. The dates are incorrect if you're portraying 1 July through 30 Sept. In the Date function, months are 0-based, so July is 6, not 7 (lines 5, 6, and 7) The SeasonPerc was a NaN since you were converting the Dates to numbers (lines 5, 6, and 7). The DateDiff function needs Dates as input, not the converted number. DateDiff also returns a number, so there's no need to convert it (lines 9 and 10) SeasonPerc has to be an integer if you're putting it into a integer field (line 11). If it's not converted (and Arcade will not convert it for you), that field attribute will be null. You have to push a dictionary object containing the "attributes" key into the features array (line 15) var ThisYear = Year(Now());
//var ThisMonth = Month(Now());
//var ThisDay = Day(Now())
var startDate = Date(ThisYear, 6, 1);
var endDate = Date(ThisYear, 8, 30);
var currentDate = Date(ThisYear, 6, 25);
var Season = DateDiff(endDate, startDate);
var SeasonSoFar = DateDiff(currentDate, startDate);
var SeasonPerc = Round(Number(SeasonSoFar / Season * 100));
var features = [];
Push(features, { attributes: { DayPercentage: SeasonPerc } });
var PercDict = {
fields: [{ name: "DayPercentage", type: "esriFieldTypeInteger" }],
features: features
};
var features2 = FeatureSet(PercDict);
return features2;
... View more
2 weeks ago
|
0
|
2
|
157
|
POST
|
That appears to be the page for 4a1e7bbdef0045599cbf567451bcd2bf
... View more
2 weeks ago
|
0
|
1
|
101
|
POST
|
What do you see on the page https://thebluemountains.maps.arcgis.com/home/item.html?id=2a7e2d06a6b34823baef6a367fea0429#overview
... View more
2 weeks ago
|
0
|
3
|
123
|
POST
|
Did you try var fs = FeatureSetByPortalItem(Portal('https://thebluemountains.maps.arcgis.com/'), '2a7e2d06a6b34823baef6a367fea0429', 0, ['S_CanConne_', 'S_Reserved', 'S_DesWpro'], false);
... View more
2 weeks ago
|
0
|
5
|
251
|
Title | Kudos | Posted |
---|---|---|
1 | 15 hours ago | |
2 | yesterday | |
1 | Monday | |
1 | a week ago | |
1 | 2 weeks ago |
Online Status |
Offline
|
Date Last Visited |
18 hours ago
|