cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TanguyT
Level 8

multiple Many-to-many relationships and data loading weirdness / bug

Hi team,

One of my PCF controls (for Model Driven app) displays many-to-many relationship available records as checkbox (or toggle).

 

One user reported issue with data loading when having two many-to-many relationships between the same records.

 

I reproduced the error. To do so:

  • Added two subgrids for each relationship on the form
  • Configured them to use my PCF control
  • Publish form
  • Load the form for a record

What we can see is that all linked records for both relationships are ticked in the PCF for the first relationship. The second PCF see no ticked checkboxes (see attached picture)

 

It seems to me that the PCF control receives data from all many-to-many relationships in the first control, then nothing is send to the second control.

 

The fact that the name of the relationship is not passed to PCF makes me think the records are retrieved based on all relationships

 

Any thoughts? @HemantG ?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
TanguyT
Level 8

Re: multiple Many-to-many relationships and data loading weirdness / bug

I was completly wrong, sorry for that.

 

So it turns out that as multiple instance of the same PCF control reside in the same form, controls must have unique ids. My control was inserting same id multiple time which explains the whole behavior.

 

Lesson learnt : Be sure to always have unique id, meaning add in the id the name of the attribute or dataset you are playing with so that the id is always unique.

View solution in original post

2 REPLIES 2
TanguyT
Level 8

Re: multiple Many-to-many relationships and data loading weirdness / bug

I was completly wrong, sorry for that.

 

So it turns out that as multiple instance of the same PCF control reside in the same form, controls must have unique ids. My control was inserting same id multiple time which explains the whole behavior.

 

Lesson learnt : Be sure to always have unique id, meaning add in the id the name of the attribute or dataset you are playing with so that the id is always unique.

View solution in original post

Power Apps Staff HemantG
Power Apps Staff

Re: multiple Many-to-many relationships and data loading weirdness / bug

Thanks for figuring this out and sharing the solution @TanguyT . I also ran into this once and one of my demo was magical :).

Usually Math.random(); does the trick if there is not a need of something as rigorous as Guid.  

 

I will send  a note to doc team to add this to the best practices for upcoming doc updates. 

 

Hemant 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (5,633)