The goal is to populate a popup in an online map that contains data from a related table. Each record will have two related records, one for each end of the feature. I have it so the data will populate, but now I need to make it so the Domain Description displays as opposed to the Domain Code. The code is as follows:
var features = FeatureSetById($datastore, "8", ['*'], false);
var fk = $feature.GlobalID;
var filterStatement = 'CulvertID = @fk'; var relatedData = Filter(features, filterStatement);
var popupString = ' '
for (var f in relatedData)
{
popupString +=
"Culvert ID: " + DefaultValue(f.CulvertID, 'no data') + TextFormatting.NewLine +
"Bound: " + DefaultValue(f.Bound, 'no data') + TextFormatting.NewLine +
"Condition Index: "+ DefaultValue(f.ConditionIndex, 'no data') + TextFormatting.NewLine +
"Embankment Condition: " + DefaultValue(f.EmbankmentCondition, 'no data') + TextFormatting.NewLine +
"End Extension: " + DefaultValue(f.EndExtension, 'no data') + TextFormatting.NewLine +
"End Location: " + DefaultValue(DomainName(features, 'EndLocation'), 'no data') + TextFormatting.NewLine +
"End Section: " + DefaultValue(f.EndSection, 'no data') + TextFormatting.NewLine +
"End Section Detached: " + DefaultValue(f.EndSectionDetached, 'no data') + TextFormatting.NewLine +
"End Section Material: " + DomainName(FeatureSetByRelationshipName($feature, "MDOT_SDE.MDOT_SDE_ADMIN.MdotCulvertEndInventory"), 'EndSectionMaterial') + TextFormatting.NewLine +
"Extension Dime Same as Culvert: " + DefaultValue(f.ExtensionDimeSameAsCulvert, 'no data') + TextFormatting.NewLine +
"Extension Material Same as Culvert: " + DefaultValue(f.ExtensionMaterialSameAsCulvert, 'no data') + TextFormatting.NewLine +
"Footing Exposed: " + DefaultValue(f.FootingExposed, 'no data') + TextFormatting.NewLine +
"Install Year: " + DefaultValue(f.Installyear, 'no data') + TextFormatting.NewLine +
"Invert Above Channel Bottom: " + DefaultValue(f.InvertAboveChannelBottom, 'no data') + TextFormatting.NewLine +
"Scour Protection Type: " + DefaultValue(f.scour_prot_type_cd, 'no data') + TextFormatting.NewLine +
"Rip Rap: " + DefaultValue(f.Riprap, 'no data') + TextFormatting.NewLine +
"Rip Rap Condition: " + DefaultValue(f.RiprapCondition, 'no data') + TextFormatting.NewLine +
"Safety Grate: " + DefaultValue(f.SafetyGrate, 'no data') + TextFormatting.NewLine +
"Scour: " + DefaultValue(f.ScourPresent, 'no data') + TextFormatting.NewLine +
"Sediment Depth >20: " + DefaultValue(f.SedimentDepthGreater20, 'no data') + TextFormatting.NewLine +
"End Section Extension Length (ft): " + DefaultValue(f.EndSectionExtLength_ft, 'no data') + TextFormatting.NewLine +
"End Section Remarks: " + DefaultValue(f.EndSectionRemarks, 'no data') + TextFormatting.NewLine +
"Field Vertification Date: " + DefaultValue(f.invt_field_vrfy_date, 'no data') + TextFormatting.NewLine +
"Inventory Field Verification User: " + DefaultValue(f.invt_field_vrfy_user, 'no data') + TextFormatting.NewLine +
"Field Verification Company: " + DefaultValue(f.invt_field_vrfy_cmpy_cd, 'no data') + TextFormatting.NewLine +
"User Create: " + DefaultValue(f.UserCreate, 'no data') + TextFormatting.NewLine +
"System Create Date: " + DefaultValue(f.SystemCreateDate, 'no data') + TextFormatting.NewLine +
"User Modified: " + DefaultValue(f.UserModified, 'no data') + TextFormatting.NewLine +
"System Modified Date: " + DefaultValue(f.SystemModifiedDate, 'no data') + TextFormatting.NewLine + TextFormatting.NewLine
}
DefaultValue(popupString, 'No attributes to show')