Select to view content in your preferred language

Arcade Expression Popup NaN - relationship class table

363
1
07-05-2023 01:49 AM
LianneStegink_gelderland
New Contributor

Hi, 

I need some help. I have a related table (relationship class) but only 1/3 of my arcade function is working. The records that say NaN should say Gereed....

LianneStegink_gelderland_0-1688546435601.png

The data is all the same for all 6. So I don't know what to do. 

I put my arcade expression below. 

Thank you in advance. 

 

~~~~

// weergaven monitoring uit tabel
var SNL = FeatureSetByRelationshipName($feature, "Tabel_2023")

//koppeling met gebiedsnaam (tabel en kaart)
var gebiedsnm_SNL = $feature.gebiedsnaam
var koppeling = "Naam = '" + gebiedsnm_SNL + "'"

//filter van de koppeling
var filterSNL = filter(SNL,koppeling)

//aantal vlakken's per vlak
var aantalSNL= count(filterSNL)

//popup
var popup = ''
if (aantalSNL > 0) {

for (var f in filterSNL){
    popup += Text(f.Gepland_Inventarisatie_jaar) + TextFormatting.NewLine + "GLK:" + " " + Text(f.GLK) + TextFormatting.NewLine + "Natuurmonumenten:"  + " " +
    Text(f.Natuurmonumenten) + TextFormatting.NewLine + "NPHV:"  + " " +
    Text(f.Nationaal_Park_De_Hoge_Veluwe) + TextFormatting.NewLine + "Staatsbosbeheer:"  + " " +
    + Text(f.Staatsbosbeheer) + TextFormatting.NewLine + "VALA:"  + " " + Text(f.VALA) + TextFormatting.NewLine + "Bosgroepen:"  + " " +
    + Text(f.Bosgroepen) + TextFormatting.NewLine}

} else {
    popup = 'No Records';
}
return popup

~~
0 Kudos
1 Reply
jcarlson
MVP Esteemed Contributor

Do you ever expect to see more than one related record? Is it possible the first record returned just doesn't have the values you're expecting to see? Try adding Console(f) to your expression so you can verify the information coming from the feature.

I would consider using an Arcade popup element instead of a single field expression like this. You'd be able to have the Monitoring section show up as its own field list.

- Josh Carlson
Kendall County GIS