Okay, I’m still having no luck utilizing any usersettings. I’m able to set them and I’m able to confirm they are set as expected when displaying the usersettings panel. But I have zero luck in accessing the values of usersettings. As an experiment, I just created a little test app. At startup, it creates a user setting called “Club” and assigns a value of “DYC” to that usersetting.
However, when I test the value, the field shows blanks where I expect to see the value “DYC”. Same result when I try to apply the usersetting value in displayed text, in table security filters, etc.
And just to clarify… the real reason I’m trying to access usersettings values is so that I can include them in security filters. So, all my records will include a [club] field and i’d like the user to only see records where [club]=usersettings("Club). As above, when I try this formula, there is no value in usersettings(“Club”), so the formula gets the green checkmark, but fails to work as expected.
Yes, I’ve read this a dozen times and it sets my expectations for how this SHOULD work, but doesn’t seem to help me understand why it doesnt work. Is there some aspect of it you think I’m overlooking?
I would advise using the suggested value there and not the formula. Or choose a value from the suggested. And for the security filter, use the formula USERSETTINGS(“Club”)=[Club]
Yes, I would love to do that. However, USERSETTINGS(“Club”) appears to have no value when I try to use it in a formula. When I copy your suggested formula into a security filter, I get zero records. When I change it to “DYC” = [Club], I get exactly the results I expect. And when I display settings, it says that Club = “DYC”. So, i’d love to follow your advice, however, as far as i can tell, your advice does not address the root problem which is that the values of usersettings are not working for me in any formula, anywhere.
I see 2 issues/pain-points, which are probably combining to make it seem like a bigger issue.
You’re using the test screen from expression assistant. This is subject to a few restrictions that aren’t always obvious. It also tells me that you’re testing from within the editor, instead of actual app functionality.
You’re not actually setting the value of that setting to “DYC”, you’re just assigning it a formula. That formula still needs to be evaluated. And then following from the fact that you’re testing within the editor, user setting evaluation works weird within the editor. It sort of resets everytime you refresh the editor page, and/or doesn’t actually evaluate.
So my suggestion for you is this.
A. Test this stuff actually in the app.
B. Don’t assign the formula to the usersetting for testing. Actually go into the user settings and manually enter the value, and save.
C. Add a virtual column to some table in the app with your USERSETTINGS(“Club”) expression. In the app, view a record on that table to verify the returned value.
Yes, thanks Marc & SKy, we are getting somewhere. Much of Marc’s advice concerning test the app rather than review the test output I was already doing & just didn’t mention in the original note.
Probably as you two were typing notes, I just did a test where I removed the formula from my usersettings, replacing it with a user edited value first, which proved successful, and then changing it to an initial setting formula, which also seemed to work.
So, the short answer appears to be, as Sky suggested: DON’T USE FORMULAS IN USERSETTINGS!
It seems weird to me that the formula column appears there, evaluates as expected when entering a formula, displays the value expected in settings panel, but then doesn’t work when you actually go to use the value!