Hi, in my app we have reports submitted by users that are shown in a list. I want to add a filter to be able to show types of reports based on the user type who submitted them (Pro or All).
Users are marked as Pro or not with a True/False in the User collection.
I’m trying to figure out a way to do this, starting off with the Switch component, but the List filters only let us select True or False, not to show based on the switch input.
Switch (like a Toggle) is directly attached to some True/False property of a record in a collection.
I don’t see any easy way to do what you want with a single switch, all it requires a bit of work.
One option which I can suggest: you could have 2 lists (pro and non-pros), have some tmp true/false property (call it “showprolist”) for logged-in user (which list to show), attach switch to this property, and then change lists visibility based on it.
Another option would be to have 2 screens with the same lists but different filters.
So I checked that out, and that makes sense, however I am looking to filter the list of Dive’s by the user type who submitted them. So I might need to add something to the reports that indicates the user type that made them. I was just hoping to be able to use the property I already had for the user and not have to duplicate that data point. hmm…