Update relationship between two collections

This seems like it should be simple, but I can’t figure it out…

I have two collections:

  • Users
  • Companies

Relationship: A company can have multiple users. A user belongs to one company.

Screen 1 (Sign up)

  • User inputs name, email address, password etc and a user record is created.

Screen 2

  • I want the user to input company information into a form, and the submit button should carry out the following actions:
    • Create the company record
    • Update the logged in user record with the company name

I’ve tried every way I can think of but I can’t get the user record to update with the company name
e.g. John Smith is linked to Company X (and vice versa)

Any help much appreciated :slight_smile:

Share screenshots or do you want remote help?

Dan.trendstonedevelopment@gmail.com

So the user should complete this form

When the user selects “Create Company” button I’ve set the update actions to (a) Create the company record in the company collection and (b) then link back to the home screen:
image

But…

I want the “Create Company” button to complete a 3rd action: To update the company for the logged in user.

This is what I’m assuming should work (Update > Logged in user > Company)

Which gives me these options:

And this is where I’ve got stuck.

The objective is to allow this form submission to automatically update the logged in users company name:

Appreciate any help you can add… thanks

On this at the bottom hit users then add logged in user.

f693d7b3d176bb3f2b2961c1964d0326d487712b_2_282x500

1 Like

This is what I’m getting when I do that…

When I click “Logged in user” then “Company” is displayed. That’s the only clickable property.

But alas, does not achieve the objective.

Don’t get confused by the relationships and display of the several sub menus. Did you try to just click on Loggend In User in your last screenshot?

1 Like

Hi Karimoo,
Yep, if you’re referring to the highlighted link, I tried but it’s not clickable…
image

@AndrewP Try the following:
For the second action:

  1. Select Update > Loggedn In User
    image
    Don’t use Update > Logged In User > Company

  2. Select the company field of the user and select New Company
    image

2 Likes

That’s worked perfectly, thank you so much!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.