This is probably simple but for some reason I cannot return the field I want in a popup.
This is from a Survey123 feature layer with a repeat. Within it I have a field that creates a subject line that I want to use in my popup. Instead of returning the value it returns: object, FeatureSet
I've tried going through some of the Arcade solutions but when replacing with my data but then the popup returns blank.
var heading = '<h2>Event: '+$feature.Problem + ' | Location: '+ $feature.City + ', '+ $feature.State+'</h2>'
var geninfo = '<p><h3>' + $feature.Info + '</h3></p>'
var subject = FeatureSetByRelationshipName($feature, 'asset_capture',['SubjectLine'])
return {
type : 'text',
text : heading + geninfo + subject
}
Solved! Go to Solution.
Your variable "subject" is a FeatureSet, not a piece of text. You have to get one of the records from it and get the attribute for that record. This modification to your code gets the first record with the "SubjectLine" attribute.
var heading = '<h2>Event: '+$feature.Problem + ' | Location: '+ $feature.City + ', '+ $feature.State+'</h2>'
var geninfo = '<p><h3>' + $feature.Info + '</h3></p>'
var subject = FeatureSetByRelationshipName($feature, 'asset_capture',['SubjectLine'])
return {
type : 'text',
text : heading + geninfo + First(subject).SubjectLine
}
Your variable "subject" is a FeatureSet, not a piece of text. You have to get one of the records from it and get the attribute for that record. This modification to your code gets the first record with the "SubjectLine" attribute.
var heading = '<h2>Event: '+$feature.Problem + ' | Location: '+ $feature.City + ', '+ $feature.State+'</h2>'
var geninfo = '<p><h3>' + $feature.Info + '</h3></p>'
var subject = FeatureSetByRelationshipName($feature, 'asset_capture',['SubjectLine'])
return {
type : 'text',
text : heading + geninfo + First(subject).SubjectLine
}