I am attempting to create a visible filter in the ArcGIS Online Configure Form. I have a Feature service (it exists in ArcGIS Enterprise) that has a historical table linked to it via a relationship class. (this is a one to many join using GloablID and TableGlobalID) I am creating the Form on the table. I want to have it where a field will only show in the form (again built on the table) where the field GENERALCLASS on the feature class == "2".
Here is my example code that i think should work but i am not very good at Arcade yet. This is being created in the Logic Visible section of the Configure form.
Solved! Go to Solution.
I was able to figure this out for anyone curious here is the code
var relatedRecords = FeatureSetByRelationshipName($feature, "dbo.DamLocations");
// Check if there are any related records where GENERALCLASS is equal to "1 or 2"
var filterCondition = "GENERALCLASS = '1' or GENERALCLASS = '2'";
var filteredRelatedRecords = Filter(relatedRecords, filterCondition);
// Return true if there are matching related records, false otherwise
return Count(filteredRelatedRecords) > 0;
I was able to figure this out for anyone curious here is the code
var relatedRecords = FeatureSetByRelationshipName($feature, "dbo.DamLocations");
// Check if there are any related records where GENERALCLASS is equal to "1 or 2"
var filterCondition = "GENERALCLASS = '1' or GENERALCLASS = '2'";
var filteredRelatedRecords = Filter(relatedRecords, filterCondition);
// Return true if there are matching related records, false otherwise
return Count(filteredRelatedRecords) > 0;