Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Patch to create a record via N:N (CDS/Dynamics 365)

I've built a form with a gallery that display Products. It has a N:N relationship between Leads and Products. I've placed an iFrame on the Lead form that shows all Products.


My goal is to have a button in the Products gallery that, On Select, will create a record in a custom entity that intersects the Lead and Product entities (called "Lead Products"). There would be two lookups to populate: the Lead I'm starting from, which is passed as a param via the iFrame, and the product I've selected in my gallery (ThisItem).


I can't figure out how to get the Patch to work, can someone help me figure out what I'm doing wrong?


Patch('Lead Products', Defaults('Lead Products'), {Lead = id, Product = ThisItem})

Helpful resources


Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Power Platform World Tour

Coming to a city near you


PowerApps Community User Group Member Badge

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


Join PowerApps User Group!!

Connect, share, and learn with your peers year-round


Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 78 members 5,349 guests
Please welcome our newest community members: