Forms - Setting data automatically from a linked record

I have a form to update details for Trips. Users are associated with a Provider and I want to set the provider automatically as part of the form, but I can’t actually select that.

Here is a loom video showing DB setup and issue on the form.

Not at my computer to check but I think this is because you have a many to many relationship set up between users and providers. Try setting the relationship to- a provider has many users, a user has one provider.

Hmm… that seems odd… also I kinda need the Multi-Multi… So would a join table need to be made in the middle then do you think… ie Provider - Provider Staff - Users?

So if you had a different type of relationship set up it would say Provider > Name. And you would select that. But because it’s many to many it can’t pick a name because there are many records to choose from.

If however, you had a list of providers on the previous page that the user clicks, then it would carry the data ‘current provider’ to the current page. Then you would see the option for Current Provider > Name.

If you don’t want the user to see the provider, perhaps there’s a way to make a list on the previous page, limited to maximum one record, filtered by various criteria. Then you just sit that ‘next’ button inside the list. The user will have selected a provider based on the filter criteria without even knowing it and carry that ‘current provider’ data to be used on next page.

1 Like

Agreed with @theadaloguy - if you have many providers, how can Adalo know which one to select when the user submits the form?

I’d ask why you need multiple providers? and if you really do (i.e., different trips have different providers), then you need to build that logic in (if the destination is X, then you’ll use provider Y).

1 Like

Thanks guys, that makes a lot of sense and I had not thought it through about the many-many being the blocker, and why.

The reason for Many-Many between Users and Providers is that someone might work at more than one provider, or own more than one provider.

So I’m going to experiment a bit with drop downs as the Adalo guy suggested and see what I can do to get things to work the way I want. The insight and advice above certainly give me the right path and understanding to make this work.

Thinking about this from a higher level it makes me think it might be a neat feature for Adalo to have a little popup when going through the data links that could show why something isn’t clickable (ie M-M so can’t pick one, not associated etc) to give people some guidance (especially new creators).

If the user has multiple providers set up and there is already a relationship between users and trips, there’s no need to even store this data under trips. The provider(s) are already accessible through the user relationship. To try store providers again on the trips field is just duplication. Just like making a new field for all the user properties on every trip - no need when you’ve got the user relationship set up.

For each trip I need to show who the provider is, it’s a list of trips from different providers…

So if a user can have 2 providers but a trip can only have one provider, how could that be set automatically?

To access the provider and display it you will create a list, current trip > user > providers.

Not quite following what you are asking/saying there, it’s a bit over my head as far as understanding relationships etc I think. For now I’ve added a drop down in the Trip creation process where the users selects the Provider they are creating the trip for. It’s workable at this point.