Hello! I am working on a Field Maps project where users in the field are inspecting parking lots. I am using 11.1 Enterprise Portal.
I created a layer of the parking lots that need to be inspected and I created a related table for the inspections. I then created a web map with the layer and now I am setting up the Field Maps form.
Everything is working as intended however I want to calculate a couple answers from the Parking Lots layer into the Inspection Form to ensure data accuracy like the Lot Name and the Lot ID.
I had this working on my AGOL prototype with the following code:
var LotData = FeatureSetByRelationshipName($feature, "ParkingLots", ['*'], false);
var Pull = First(LotData)
if(Pull == null) {
Console("Data is null -> Data is empty")
} else {
Console(Pull.Lot_Name)
}
return(Pull.Lot_Name)
I rewrote it to switch to Enterprise. It "works" however it always returns the attributes of Lot #1. FeatureSetByRelationShipName was not working so I switched to FeatureSetByName. New code below:
var LotData= FeatureSetByName($datastore,"ParkingLots", ['*'], false)
var record = First(LotData)
if (IsEmpty(record)){
return "No Record Found"
}
return record['lot_name']
Any ideas?
I have a feeling I need to use Filter before First however I have not been able to get anything to work.
Thanks!