Create a new record in another table and get an instant connection

Hi,
I have 2 tables which are tied together with a connection field. The tables are User and Home. Home is connected to a user through a connection field.
Is it possible to create, upon signup, immediately add a new record to Home and tie it directly to the User ( through the connection field). My aim is that after signup, the user gets directed to a Home table where he can further edit the home details. I don’t want to use the add button, since I only want to allow my users just to add 1 Home. Because when I use the Add function, there is a possibility for the User to add more homes…

Currently I used record rules on Sign up form, but (both add a new record or add a new connected record) but both are not currently working.

1 Like

Hi @slimpens I would have tried exactly what you’ve suggested a record rule that adds the connected record. I don’t understand why that wouldn’t work for you. What doesn’t work, the join or the record isn’t created?

@GREDDIE ,

Apparently, on the signup process there is no record yet at Home tab and therefore a connection cannot be set up.

Hey @slimpens

Can you post a screenshot here of the record rule on the signup form?

I have the exact same problem: when a new user (company admin) signs up, he should be able to create one (and only one) company record. That’s why the “add company” button (from a form) isn’t an option. Users could add multiple companies.

when using the record rule to create a company (in your example: Home), it is possible to connect the company (Home) back to the user using “Record Rules” :slight_smile:

Action = Insert a Connected Record
Select Connected Data Table to Insert Record Into = Company (or Home)
(No condition)
Set the Record Value of “Company Admin” = Logged In User

That creates a connected record Company → User

However, I still need a connection User → Company…

It is only possible to do a one-way connection…

@tim.young
Hey, here is the screenshot.
So the aim is that once a user is signed up, a record is automatically created (and connected) to the logged. I tried a lot of setups, but I still can’t get it fixed.

Don’t set the join value, let the system join the records together. Set a different field on the Company table then it will work.

Also, in your testing make sure you’re adding the user from the Signup form rather than just adding a record in the database, otherwise the form’s record rule will not execute.

Ok, the signup contains “name” + “email” … Do you mean to create a dummy (name 2?) option in the Company table (in my case Home table). and set a record? How does the system tie the records together?

The system uses the recordid of the two tables (these are hidden by default but you can create these if you want to see them) (How to save a Record ID) to connect the records. It knows the user record and it just creates a new record in the Company / Home table that is connected to this.

You have to write at least one value to the newly connected record in order to get it to save. If you don’t need anything, consider adding a lastmodifiyuserid text field and place the logged-in-user name into it.

I simply created a decision checkbox field called Company Admin and set this to checked.

1 Like

@GREDDIE ,
thanks a lot, it works now!

1 Like

the connection is made both ways, but you should usually join from the child to the parent.