Select to view content in your preferred language

Attribute Rule not Populating the fields that it needs to

101
0
a month ago
Labels (2)
Gabrielle_Byczek
Emerging Contributor

Thiese are the fields that are not returning:

"Adopted_By": 
"Adopter_Contact_Email"
"Adopter_Contact_Number"
    

When we enter the survey, we enter in all the parameters, and they go to the ADOPTCREATOR.PW_CityBeautiful_AdopterApplications table --> Then it goes to the segments layer. We have met with ESRI five times with no luck. I could really use some help. Thank you

 

 

if ($feature.Adoption_Status != "Approved") {
    return ;
}
var parent_id = $feature.GlobalID;
if (IsEmpty(parent_id)){
    return;
}
// Could use https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyrelationsh... also
var relatedTab = FeatureSetByName($datastore, "ADOPTCREATOR.PW_CityBeautiful_AdopterApplications", ['GlobalID', 'Parent_GUID', 'Name', 'Email', 'Phone_Number'], false)
var relatedRec = First(Filter(relatedTab, 'Parent_GUID = @parent_id'))
if (IsEmpty(relatedRec)){
    return;
}

 

return {
    "result": {
        "attributes": {
            "Adopted_By": relatedRec.Name,
            "Adopter_Contact_Email": relatedRec.Email,
            "Adopter_Contact_Number": relatedRec.Phone_Number
        }
    }
}

 

 

0 Kudos
0 Replies