cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abiarge
Regular Visitor

How to populate a many-to-many relationship via form

Hi,

 

I'm trying to create a N:N relationship between 2 entities: Projects (custom entity) and Users (system entity). The goal is to set a relationship between the users involved in a project for traceability purposes. A single project can have many users involved and a single user can be involved in different projects.

 

However, I can't see how to set a main form for the entity Projects so that I can populate the relationship between the newly created project and the users involved.

 

I would like to have a field for the form of the entity "Projects" where I can select multiple users (from the entity Users) that will be involved in this project.

 

I've tried to work it out through the classic view when editing the form, but my N:N relationship doesn't show on the "Relationship Explorer"

 

I hope I have explained myself good enough.

1 ACCEPTED SOLUTION

Accepted Solutions
DavidJennaway Responsive Resident
Responsive Resident

Re: How to populate a many-to-many relationship via form

You'll only be able to enter data in the sub-grid once the parent record is saved. However, I would have expected the grid to still display before the record is saved

View solution in original post

4 REPLIES 4
EricRegnier Impactful Individual
Impactful Individual

Re: How to populate a many-to-many relationship via form

Hi @abiarge,

In classic view, can you open the N-N relationship settings and make sure the Display Option is not "None" and the Searchable is set to "yes"? Then on the Project form, insert a subgrid and in the properties set Users as the records type and then you should be able to multi select users with the "Add Existing User" button.

2020-05-21_8-48-02.png

Hope this helps!

 

abiarge
Regular Visitor

Re: How to populate a many-to-many relationship via form

Hi @EricRegnier ,

Thanks for answering, but no luck with that approach.

I had previously tried the subgrid approach with the following configuration:

foto1.PNG

 

This means that in the classic view, it's configured this way:

foto2.PNG

 

But, when trying to add a record, the subgrid field doesn't even show:

foto3.PNG

 

Have I misconfigured something?

DavidJennaway Responsive Resident
Responsive Resident

Re: How to populate a many-to-many relationship via form

You'll only be able to enter data in the sub-grid once the parent record is saved. However, I would have expected the grid to still display before the record is saved

View solution in original post

abiarge
Regular Visitor

Re: How to populate a many-to-many relationship via form

@DavidJennaway that was it. I understand that the join table that establishes the N:N relationship obviously needs a record on the first table to exist, but I thought the form would first create the row on the first table and then create the relationship in the join table. This should be on the docs, I guess...

 

Anyway, thank you a lot! 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Users online (6,093)