Select to view content in your preferred language

Having trouble with joining Feature Layer and Feature Table

382
0
01-20-2022 02:24 AM
Labels (1)
SayedWali
Regular Contributor

Hi All,

I am joining a feature layer with a feature table which is a repeated table. I think the parameters are correct but when I click on Test button, nothing appears. It doesn't load data. I get GlobalID from the main layer and ParentGlobalID from the feature table.

 

Here is my code:

 

var portal = Portal("https://www.arcgis.com/")
var mainfs = FeatureSetByPortalItem(portal,"365e0c417cd34bfdb06039c76715079e",0,["*"],false)
var tablefs = FeatureSetByPortalItem(portal,"365e0c417cd34bfdb06039c76715079e",1,["*"],false)

var joinedDict = {
  fields: [
    { name: "FeatureID", type: "esriFieldTypeGlobalID" },
    { name: "Grant", type: "esriFieldTypeString" },	
    { name: "HazardID", type: "esriFieldTypeString" },
    { name: "DTAreaCleared", type: "esriFieldTypeDouble" },
  ],
'geometryType': '',
'features':[]}

var i = 0;
for (var t in tablefs) {
    var tableID = t["ParentGlobalID"]
    var filt_mainfs = Filter(mainfs, "GlobalID = @tableID")
    for (var p in filt_mainfs){
        joinedDict.features[i] = {
            attributes: {
                FeatureID: tableID,
                Grant: p["Grant_Number"],
				HazardID: t["Hazard_ID"],
                DTAreaCleared: t["DT_Area_Cleared"],
            }
        }
    }
i++
}

//return dictionary
return FeatureSet(Text(joinedDict));

 

 

0 Kudos
0 Replies