I am using the users config for to filter users view, however i not wanted to allow what user modified yours config, wanted to allow the user to select only once.
You want to create an functionality where the user can see & update his/her own data only?
Almost this, I want to create a feature that the user only sees the data of your company, so when he selects your company in the user settings, I prevent it from changing that choice.
Soโฆ you would like to select the company from the list (using Usersettings) and when thatโs done, you canโt change it anymore with that same device?
Exactly that, do you help me?
What if your user selects the wrong company? He would be viewing other company data (is this a problem?), and also have no way of fixing it.
So I want to do this and leave the user on alert, if he selects wrong it will be necessary to create a new user.
Rather than having the user select his/her company to view, is there a way to tie to users email to the โproperโ company assignment so errors are not made? I am not clear on your use case, but was thinking an access table might create a better experience?
User email โฆ Company
Following @Mike. No need to choose anything thenโฆ the email address would do that job.
By what I understood this would be done through a certain business domain? But some of the companies do not contain these business emails are just physical people!
If your use case is a limited set of companies to select from, and the users must be associated to a particular company, you could maintain a simple user email list with associated permitted company. You can then use a slice with ShowIf to only show records associated with that users linked company.
This works well when:
Again, without really knowing your actual use case itโs a bit hard to make a good recommendation.
If you want an arbitrary user to select a single company, without any predefined control over what they can select, then you could also store that selection in the โsettingsโ table as a preference. I just doubt that is what you really want?
But I do not know who the users are going to use, I only know the companies:
So what Iโm trying to do is be able to separate the data of each vendor for their particular companies.
For example: I have company X and company Y, company X can only see the sales of its own sellers but can not see the sale of the sellers of company Y;
What i was trying to do is that when the business owner selects his name in the settings, he will not be able to change his choice. So I compare USERSETING () with the company name of each seller selected on your sale.
Donโt use user settings. Instead, use a normal table, one row per user, and record the userโs choice there when the row is added. The following Editable_If expression prevents changes after an initial save:
NOT(IN([_THISROW], FILTER("MyTable", TRUE)))
replacing MyTable
with the name of this table.
Okay, but how do I select a column from the โMyTableโ table?
In all likelihood, the MyTable (or whatever you call it) table will use the userโs email address (from USEREMAIL()) as the key column value (e.g., email). You can use LOOKUP() to find the current userโs row and get the userโs chosen company name:
LOOKUP(USEREMAIL(), "MyTable", "email", "company_name")
where MyTable
is the name of the table, email
is the name of the column storing the userโs email address, and company_name
is the name of the column containing the userโs company choice.
Thank you very much, it helped me a lot.
User | Count |
---|---|
43 | |
29 | |
24 | |
21 | |
13 |