First time posting. Love appsheet heaps.
Question, i have declare a usersettings variable to lookup an ID of a table (contacts) by USEREMAIL(). Then, i declare another variable under user settings, using the ID from before, to lookup another ID of another table that belong to the user (classes).
Objective is to have these two variables declare so i can filter out records and only show those contacts below to the userโs class, instead of showing all contacts from the institute.
Is this nesting relationship not supported? Seems to be a slice use case but i am trying to short cut it so that i donโt have to create slice per class. (I have more than 10 classes)
Solved! Go to Solution.
What you want to do is possible, but as @SkrOYC suggests, slices would be the better way to go.
Create a slice named (for example) My Contact
on the Contacts
table, with a row filter expression like:
(USEREMAIL() = [Email])
The slice should then contain only the row(s?) from the Contacts
table with an Email
column value that matches the current app userโs email address.
Then create a second slice named (for example) My Classes
on the Classes
table, with a row filter expression like:
IN([ID], My Contacts[ID])
This slice should then contain only the rows of Classes
that have an ID
column value that matches the ID
column value of the current app user.
Welcome to the community.
UserSettings donโt work with App Formulas from our testing so you will need slices for that.
I donโt know if you will need one for each class, maybe we can help with that
Thanks SkrOYC. i can see that the value is being populated under settings of the app. It seems that, not only lookup formula works, but the output of a user setting variable, can be referenced by another variable.
However, when the app is instantiated, i think the usersetting variables are populated after. Or, security filter doesnโt like the [Class ID] = USERSETTINGS(LOGIN_CLASSID) formula. Interesting, there is no error message but not result returned from that condition. however, when i hard code that value to a particularly Class ID, it works beautifully. So something must have had happened when usersettings is instantiated. If someone can advise how the usersetting is instantiated and by when during the execution, that would clear the confusion.
Given performance, i think Slice approach meant to be. Will give that a crack today.
What you want to do is possible, but as @SkrOYC suggests, slices would be the better way to go.
Create a slice named (for example) My Contact
on the Contacts
table, with a row filter expression like:
(USEREMAIL() = [Email])
The slice should then contain only the row(s?) from the Contacts
table with an Email
column value that matches the current app userโs email address.
Then create a second slice named (for example) My Classes
on the Classes
table, with a row filter expression like:
IN([ID], My Contacts[ID])
This slice should then contain only the rows of Classes
that have an ID
column value that matches the ID
column value of the current app user.
Thanks Steve on the advice. I will implement Slice today. As far as i understand, Slicing is better approach because you filter records and read into the app first. Where as, security setting is more in app filtering. Am i correct?
User | Count |
---|---|
43 | |
27 | |
23 | |
14 | |
12 |