Hello community-
I'm trying to filter records in a feature class based off multiple fields. I am able to do this fine until I try include a field that contains coded values in my filter.
This works (no coded values):
var hydrants = FeatureSetByPortalItem(Portal('https://xyz.com/portal/'), '123123123123123123' , 1, ['*'], true)
var above_filt = Filter(hydrants, "(LifeCycle_Status = 'Active') AND (Model IS NOT NULL)")
return Count(above_filt)
However, when I try to include the field (Manufacturer_Key) that has coded values, I receive the "Parse Error:Line 3: Unexpected identifier" message:
var hydrants = FeatureSetByPortalItem(Portal('https://xyz.com/portal/'), '123123123123123123' , 1, ['*'], true)
var above_filt = Filter(hydrants, "(LifeCycle_Status = 'Active') AND (Model IS NOT NULL) AND (Manufacturer_Key IS NOT NULL)")
return Count(above_filt)
Any help is greatly appreciated!
I figured out what was going on here. The issue is the field name I was using was invalid, so I was getting an error. Though this seems like a pretty dumb mistake to make, our system is set up in such a way this actually exposed a deeper error. I'm not going to get into it, but make sure you're using the field names for the layer you're actually calling.