Select to view content in your preferred language

Obtain data from different layer - blank issues

105
1
01-29-2025 02:42 PM
aduyvesteyn
Emerging Contributor

When trying to obtain data from another layer in the pop-up I use this code:

 

var address = FeatureSetByName($map,"Civic Addresses",['full_address'], false)
return address

 

Which populates results, as shown below:

aduyvesteyn_0-1738190328808.png

But when I go view the popup I get [object Object] instead of the civic address, described in the code above. 

I used this link for reference. 

Has anyone ran into this issue, if so how did you fix it?

 

Thank you in advance

 

 

Tags (3)
0 Kudos
1 Reply
DavidSolari
MVP Regular Contributor

That function returns a FeatureSet object which the popup appears to have trouble with. There's probably a way to turn that into popup friendly data, but chances are you just want one address's data or an aggregate of address data based on the feature selected. Try something like this:

var addresses = FeatureSetByName($map,"Civic Addresses",['full_address'], false);
var filter_value = $feature.my_field;
var address = First(Filter(addresses, "full_address = @filter_value"));  // Replace with a proper SQL statement
return address.full_address
0 Kudos