Cannot Access UserSettings Values

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.

I confirm that the value is set properly by looking at the user settings:

Then I try creating a formula for a table to make the value of a text field =USERSETTINGS(“Club”). I get the green checkmark.

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.

I also tried replacing =Usersettings(“Club”) with =[_THISUSER].[Club], but the results are the same.

Is there some sort of secret handshake that I’m missing? What do I have to do to make the values in usersettings accessible?

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.

User Settings: The Essentials - AppSheet Help

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?

1 Like

Is the Show? property for the Club column enabled?

Yes.

condition is true if

USERSETTINGS(“Club”)=“DYC”

I have no idea what you’re intending to tell me with this response.

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.

if you want, give me access to your test application. one head is good, but two is better)))

I see 2 issues/pain-points, which are probably combining to make it seem like a bigger issue.

  1. 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.

  2. 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.

2 Likes
Do not use AppFormula on a UserSetting
1 Like

I wrote the same…

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!

Thanks for the help everyone!

1 Like

Just to be clear, App Formula is a viable thing that can be used in User Settings.

2 Likes

So, I guess an example of how to use it would be that a user updates one setting and another gets automatically recalculated?

1 Like