Data Type “User” has:
“Account Type” Option Set.
“Company” Data Type
An Admin creates an account, so a user with Account Type (Option Set) Admin.
He then has the option to create a Company (Data Type).
So in the workflows this is “create a new thing: company”.
When the Admin does this, the company gets created, but in the App Data, the Company field is empty for the User and the user is not in the Company.
I need to manually connect them both ways.
Why is this?
How can I solve this?
After this the Admin can create “Employee” users, they also need to be connected automatically to the same company.
The Admin User creates a Company.
The Company gets created.
But the field “Admin” in Company, which is a list of users, is empty.
And the field Company for the User is also empty.
In the workflow that creates the company, add a step that makes changes to the current user, and set the user’s company field to the result of the step that creates the company.
You’re setting the company to the current user’s company, and that doesn’t make sense. Set the company to the result of step 1, and you should get the desired result.
So this works, the company is asigned to the admin.
But because I want to know who the Admins of a company are, i created “Admins” under “Company” as a “list of users”.
How do I automatically fill in this field now in App Data?
So the Admin that created the company for example also is in this list.
When you create the company, add the current user to the Admin field.
By the way, just some friendly advice here… what you are trying to do is about as basic as it gets in Bubble, so you might want to consider taking a step back and working through the tutorials and watching the academy videos. Bubble’s learning curve is steep, and without a good understanding of the basics, you are really going to struggle to get up that curve.