Hi. I am currently trying to join a table to a point hosted layer to display additional fields in a pie chart in dashboard. My current script ( I used a little of it from GitHub) doesnt show any errors in the actual script but comes up with this error :
Expected "!=", "(", "*", "+", "-", "/", "<", "<=", "<>", "=", ">", ">=", "AND", "OR", [ \t\n\r], or end of input but "5" found.
Does anyone know where the errors lies? I can't locate any wrong syntax so thinking it may be another issue? My script is below (pointfs is the feature set and tablefs is the table I want to join to - based on a common attribute that holds Postcodes (PostcodeSector)) :
(I've removed the portal link at the top for privacy).
var portal_Link = Portal('xyz');
var pointfs = FeatureSetByPortalItem(portal_Link,'17d25668c1ee4904ac2920558175f291',0,["*"], false);
var tablefs = FeatureSetByPortalItem(portal_Link,'76a135fad8db4da7bc2932ec7c58dd5b',0,["*"], false);
var features = [];
var feat;
for (var t in tablefs){
var tableID = t["user_postsector"]
for (var p in Filter(pointfs, "Postcode_Sector= "+tableID)){
feat = {
attributes: {
organisation: tableID,
PostcodeSectorAv: p["user_postcodesectoraverage"],
PostcodeSectorCount: p["user_postsectorcountvalued"],
GSS_CODE: t["GSS_CODE"]
}
}
Push(features, feat)
}
}
var joinedDict = {
field: [
{name: "organisation", type: "esriFieldTypeString"},
{name: "PostcodeSectorAv,", type: "esriFieldTypeInteger"},
{name: "PostcodeSectorCount", type: "esriFieldTypeInteger"},
{name: "GSS_CODE", type: "esriFieldTypeString"},
],
'geometryType': '',
'features':features
};
return FeatureSet(Text(JoinedDict));