Hi there,
I am trying to use an IIF calculation to determine whether a switch should be selected to 'yes' or 'no' based on a field in the parent data.
When I use the following calculation:
Features = FeatureSetByRelationshipName($feature, 'WCC_Hort_Site_Auditing_XV2X_inspection_audit');
the result is
However, when I try to input this into an IIF statement:
Solved! Go to Solution.
You're correct in your thinking that it's a question of improperly evaluating a FeatureSet. You have to get a Feature from that FeatureSet to do that. If you're expecting only item to be in the FeatureSet, use First to get that feature and perform your evaluation.
var fs = FeatureSetByRelationshipName($feature, 'WCC_Hort_Site_Auditing_XV2X_inspection_audit');
var feat = First(fs);
iif(feat['bedding']=='yes','yes','no');
You're correct in your thinking that it's a question of improperly evaluating a FeatureSet. You have to get a Feature from that FeatureSet to do that. If you're expecting only item to be in the FeatureSet, use First to get that feature and perform your evaluation.
var fs = FeatureSetByRelationshipName($feature, 'WCC_Hort_Site_Auditing_XV2X_inspection_audit');
var feat = First(fs);
iif(feat['bedding']=='yes','yes','no');
that worked great thank you