Arcade script which working good with ArcGIS Pro 3.1 is not working with ArcGIS Pro 3.2. Is it a known Bug?
Solved! Go to Solution.
No known issues in 3.2, all scripts should just work.
Looking at the code I see you are using a variable LBCode where it is not defined, this might be a bug in 3.1 that we fixed in 3.2 (we start detecting undefined variables), you might have meant to use attributeValue instead.
thanks
I would suggest for performance avoiding using the count here and just do first and check for null and only ask for you are using. here is the rewritten script with the LBCode fixed.
var intersectLayer = FeatureSetByName($datastore, "Lsgd_Boundary", ['LBCode'], false);
var attributeName = 'LBCode';
var intersectingFeatures = Intersects(intersectLayer, $feature);
var intersectedFeature = First(intersectingFeatures);
if (intersectedFeature == null) return 'NA';
var attributeValue = intersectedFeature[attributeName];
// Generate a unique sequence number
var id = NextSequenceValue("uniqueid");
// Concatenate LBCode and the unique sequence number
var projectID = attributeValue + "-" + id;
return projectID;
Including the script in your question would be useful.
I dont think its retired. Cant find any traces of it in release note.
anyways adding code for reference
var intersectLayer = FeatureSetByName($datastore, "Lsgd_Boundary");
var attributeName = 'LBCode';
var intersectingFeatures = Intersects(intersectLayer, $feature);
if (Count(intersectingFeatures) > 0) {
var intersectedFeature = First(intersectingFeatures);
var attributeValue = intersectedFeature[attributeName];
// Generate a unique sequence number
var id = NextSequenceValue("uniqueid");
// Concatenate LBCode and the unique sequence number
var projectID = LBCode + "-" + id;
return projectID;
} else {
return 'NA';
}
No known issues in 3.2, all scripts should just work.
Looking at the code I see you are using a variable LBCode where it is not defined, this might be a bug in 3.1 that we fixed in 3.2 (we start detecting undefined variables), you might have meant to use attributeValue instead.
thanks
I would suggest for performance avoiding using the count here and just do first and check for null and only ask for you are using. here is the rewritten script with the LBCode fixed.
var intersectLayer = FeatureSetByName($datastore, "Lsgd_Boundary", ['LBCode'], false);
var attributeName = 'LBCode';
var intersectingFeatures = Intersects(intersectLayer, $feature);
var intersectedFeature = First(intersectingFeatures);
if (intersectedFeature == null) return 'NA';
var attributeValue = intersectedFeature[attributeName];
// Generate a unique sequence number
var id = NextSequenceValue("uniqueid");
// Concatenate LBCode and the unique sequence number
var projectID = attributeValue + "-" + id;
return projectID;
That works. Thank for support.
@HusseinNasser2 some of these codes when i am publishing data is having a problem in execution. Sometimes giving NULL value