FeatureSet not working offline in Field Maps

2350
11
Jump to solution
04-10-2022 02:00 PM
Scott_Sambell
Occasional Contributor

We added calculated expressions to several of our clients' Field Maps after promising that they would have all the functionality now in smart forms that we have been raving about.  Everything works perfect using Field Maps online but when we did the final test (download an offline area and sync test) we discovered that the FeatureSet function does not work offline.  We tried it on several different Android and iOS devices on several different webmaps. This is an absolute showstopper for us.  Is this a bug or a known limitation? We need to know asap so we can explain to the clients why they aren't getting what we promised

Here is an example of how we use FeatureSetByName:

var tblparent = FeatureSetByName($map, "Trap locations",['OBJECTID','Easting_Northing','GlobalID'],False);

Maybe other FeatureSet functions work but FeatureSetByName($Map,...... doesn't?  Any explantation i could get would be much appreciated.

Thanks!

 

@JeffShaner 

Scott
11 Replies
KelseySmuczynski
New Contributor III

Hey Rhett,

Thanks for the quick reply. I tried your suggestion (code below), but still received the same error.

 

var ref_guid= upper ($feature.GUID)

if(ref_guid == null) {
return null
}

var wells_fs=FeatureSetByName($map,"Wellsites2")
var wells_filter = Filter(wells_fs, `GlobalID = '${ref_guid}'`)
var well = First(wells_filter)

if (IsEmpty(well)){
return null
}
return well.Well_Name

 

Also, just to clarify, my initial code (below, just in case) was successfully populating fields in my inspection form with info from my related feature class. It stopped working when I created and used an offline map for data collection.

 

//Initial code that was successful in non-offline mode.

var ref_guid= $feature.GUID // <---No upper casting

if(ref_guid == null) {
return null
}

var wells_fs=FeatureSetByName($map,"Wellsites2")
var wells_filter = Filter(wells_fs, "GlobalID = @ref_guid")
var well = First(wells_filter)

if (well == null) {
return null
}
return well.Well_Name

 

 

Kelsey

0 Kudos
KelseySmuczynski
New Contributor III

Oops, looks like I missed applying the IsEmpty function to the ref_guid in line 3. I updated my code as shown below and it tested without issues. I'll still need to see if the changes applied to my offline maps, but will report back soon.

 

UPDATE: IT WORKED!

Thanks, @RhettZufelt and @Anonymous User . You guys are rock stars.

 

var ref_guid= upper ($feature.GUID)

if(IsEmpty(ref_guid)) { //<-- applied IsEmpty()here
return null
}

var wells_fs=FeatureSetByName($map,"Wellsites2")
var wells_filter = Filter(wells_fs, `GlobalID = '${ref_guid}'`)
var well = First(wells_filter)

if (IsEmpty(well)){
return null
}
return well.Well_Name

 

0 Kudos