I'm wondering if someone can point me to the error in my code
I am trying to add a record to an intermediary entity 'Member Agency Contact Lists'. Being an intermediary entity (creating a N:N relationship), it references the primary fields of two other entities: 'Member Agencies' and 'Member Contacts.' These primary fields are both labelled 'Autonumber' in those two entities. Within the intermediary entity, those (referenced) Autonumbers are labelled 'Agency #' and 'Contact #" respectively, and it has it's own primary field, also labelled 'Autonumber.'
I had hoped to use the selected fields within MemberAgencyGallery (which displays the entity 'Member Agencies) and ExistingContactsGallery (which displays the entity 'Member Contacts'), so that OnSelect of an icon (within ExistingContactsGallery), those selected fields would be entered in a new record in the intermediary entity 'Member Agency Contact Lists'
I am trying the following code, and when I press the icon, PowerApps seems to be doing something, but the record doesn't *seem* to be added to the intermediary entity.
Select(Parent);
Patch(
'Member Agency Contact Lists',
Defaults('Member Agency Contact Lists'),
{
'Agency #': LookUp(
'Member Agencies',
Autonumber = MemberAgencyGallery.Selected.Autonumber
),
'Contact #': LookUp(
'Member Contacts',
Autonumber = ExistingContactsGallery.Selected.Autonumber
)
}
)