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.

var f_gid = $feature.TableGlobalID;
var related = FeatureSetByName($datastore,"DBO.DamLocations", ['GENERALCLASS'], false)
var record = Filter(related, "GlobalID = @f_gid"); var filter_record = record == "2";
return filter_record
Any help is greatly appreciated.