cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent 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
Highlighted

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
Highlighted
Super User II
Super User II

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!

 

Highlighted

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?

Highlighted

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

Highlighted

@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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (10,487)