PowerApps: Account and Contacts via a Gallery View, Avoiding Polymorphic Error

ccognettaDyn365CE5 years ago13 Views

While working on a Power App Concept, I came across the need to show all the contacts that where related to an account. I was using an Account gallery to display a list of Accounts, then I was trying to filter a second gallery of items contain contacts using the ID GUID from the parent account matching it off to the contact’s parent account ID.  I kept getting the error message field types don’t match or the are not polymorphic.  This was a big challenge using the Dynamics 365 connector. However, switching to the Common App Connector, there’s special built in functionality to handle this relationship.

The command is Galleryname.Selected.Contacts – to my knowledge this does not work in the Dynamics 365 Connector and is one of the benefits of using the other connectors. See my other blog post on why to move to the Dynamics 365 Connector.

To test, I created a blank app, added gallery 1 (account) and gallery 3 (contacts) from the Common App Connector.

Now you can see when I click on the left gallery 1 for accounts, the contacts in gallery 3 are filtered by the gallery 1 account selection by the user! I am posting this very simply resolution so that someone looking to do the same simply connection can avoid the struggles above. Most of the posts talk about using type and dealing with polymorphic relationship, not very citizen developer friendly! Enjoy.

 

 

Original Post https://www.cognettacloud.net/2019/10/06/powerapps-account-and-contacts-via-a-gallery-view-avoiding-polymorphic-error/

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
March 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       
« Feb   Apr »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...