This is the code: both feature classes have the same attributes, so I want all the attributes combined except for geometry which can be ignored. When I attempt this the error code "Test execution error: Unknown Error. Verify test data." keeps popping up.
var points = FeatureSetByPortalItem(p, "22e8f851a85f4b99b1a2ce2542e9b09c", 0, [], false);
var lines = FeatureSetByPortalItem(p, "f64502f467a043658818eed4317aa90e", 0, [], false);
var combinedFeatures = [];
// Combine attributes from points
for (var i = 0; i < Count(points); i++) {
var attributes = points[i].attributes;
combinedFeatures.push(attributes);
}
// Combine attributes from lines
for (var i = 0; i < Count(lines); i++) {
var attributes = lines[i].attributes;
combinedFeatures.push(attributes);
}
// Resulting feature set
var joinedFeatureSet = {
'fields': points.fields, // All feature layers have the same fields
'features': combinedFeatures
};
return joinedFeatureSet;