Hello everyone,
I’m creating an app to manage my customers.
I have a Data for the Users, one for their Company, one for their Customers, one for their Sales Contracts.
The Datas are linked together:
Users have a CompanyUser field with the Company relationship (data)
For the Company database, a UserCompany field etc… for the others too.
When a User logs in and creates his profile + company details, to be able to display
information in the profile page I’ve created, I have to manually add the company name in the CompanyUser field in the User database.
same for the customer list, to avoid displaying all the customer data in the database.
I have to manually put the company in the CustomerCompany field to display only the customers of the current User.
Is there a solution so that when the company name is entered, a workflow action, for example, could enter the company name directly in the User.
Or an action that directly defines the company entered in the profile, all records made by the User will be properly classified and defined in the respective databases.
So I have to do everything manually that doesn’t work to use the app with several clients.
Thanks for your help.
Yes, this is definitely possibly and actually very straightforward. There’s several ways to go about it, but the first I thought of is just the workflow action ‘make changes to a thing’, and either pointing to the Customer type or User (whichever one makes sense for your database layout), and choosing the ‘CompanyUser’ field = ‘Input’ (whatever they input). If you need this company name to be more controlled, so that typos or misspellings don’t result in duplicate companies, you could instead make part of the form a drop-down of existing companies for them to choose from.
I would also recommend you looking more into how privacy roles can help with your data - by setting up proper privacy control, you can by default limit the data a particular user sees based on their company.
@msgiblin you could instead make part of the form a drop-down of existing companies for them to choose from. I think that for this part, if the user uses another company, he would have access to that company’s data if I program several users per company, don’t you?
That is true, although really with any automated way of adding company that will be the case. Do these companies have admins? If so you could instead have the user add the company, and it sends an approval message and/or email to an admin in that company to confirm they belong to that company. Or, alternatively, if you based it on email domain name, and they had to confirm their account via email, confirming they do own that email address.
Thanks @msgiblin , I’ve found a solution where when the customer registers (USER) he enters his information: email, password and company name. My workflow creates a company and then assigns the company name to the USER.
Once logged in, USER can complete his company profile and even modify it. This solves my problem of filtering data by User
There’s still one thing I can’t display in my profile page: I have 2 groups in a general group that represents the page. One with User data, where viewing and editing can be done, works. On the other side, in the Company group, I can’t display the company data of the user currently logged in.
I assign a Do and search in the source of my group but I can’t tell it to display the data of the user currently logged in. I can’t find the words.
it displays random data because I can only manage to ask it to randomly choose a company from the list, do you have any idea of the path I can tell it to take in order to correctly display the User company data?
Thanks for your feedback
It ultimately comes down to how your database and relational databases are setup, but if my understanding of yours is correct, you have a field on User called ‘Company’, and this field ‘Company’ correlates to an actual Company in data-type ‘Company’, correct? If so, the Group data source would be something like ‘Current User’s Company’s Company’. Again, the wording & order comes down to how your data is structured, but that’s the gist of it. If your ‘company’ field is instead a text field, you may need to reconsider and have this be an actual Company of datatype Company.