Baffled by UserSettings Not Working in Security Filter

Wow, really pulling my hair out over this. I am trying to apply what I thought would be a straightforward security filter using a usersetting.

I have a table, “boats” with an integer column “owner”. One record in boats has an owner value of 365. I have a UserSetting called “User_id”. For now, I’ve hardcoded the usersetting with a formula of “= 365”. In the app’s settings panel, I’ve confirmed that the User_id value is 365.

When I hardcode a security filter on boats of: “[owner] = 365”, it returns the expected result. However, with a security filter of "[owner] = USERSETTINGS(“User_id”), it returns zero results. I’ve tried endless variations, but without any joy.

What am I doing wrong? Can I not use a UserSetting value as part a security filter formula?

You can indeed reference UserSetting values in a security filter expression.

If you didn’t already, confirm that the User_id user setting column is set to the same data type–presumably Number.

Yes, I actually tried multiple data types. Also tried concatenating quote marks around the value. No joy.

I suggest post screenshots of your configuration of User Settings and the pertinent table’s security filter. Maybe that illustration will enable someone to see what’s amiss.

1 Like

I think I’ve found a work-around. Instead of a formula to store the user-id, I’m just doing a look-up of the user-id each time I need it. It seems to work better, but I’m still very curious as to why it is that I store a usersetting value but have so many problems utilizing the value in other formulas.