cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Filtering Contacts on Parent Account using Combo box and Dropdown list

I'm trying to filter Contacts based on the parent Account. The Accounts are listed in a combo box and I'd like the selected value to filter a dropdown list that contauns the contacts. I have used a CDS connector for datasouce on both Accounts and Contacts.

 

I've set the filter formula as follow: Filter(Contacts,'Company Name' = cmbAccount.Selected)

where cmbAccount is the name of the combobox. The cmbAccount Comboxox Items is set to diplay the Name foeld of the Account.

Although I'm not getting an error on the formula, the dropdown list is not filtering to just related accounts, it's just showing all Contacts in my D365

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filtering Contacts on Parent Account using Combo box and Dropdown list

Hi @Anonymous ,

Since Company Name is a Customer filed. It 's a lookup field that you can use to specify a customer, which can be an account or contact.

And its structure is:

 { _parentcustomerid_value: Acoount.accountid, _parentcustomerid_type: "accounts"}

You could try this formula:

Filter(Contacts,_parentcustomerid_value in cmbAccount.Selected.accountid)

Here's doc for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/types-of-fields

https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/How-do-I-update-CDS-Contact-entity-parentcustomerid-type-and/m-p/107829?collapse_discussion=true&filter=location&location=forum-board:CDS_Apps&q=update%20CDS%20Contact%20company%20name&search_type=thread

 

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Filtering Contacts on Parent Account using Combo box and Dropdown list

Hi @Anonymous ,

Since Company Name is a Customer filed. It 's a lookup field that you can use to specify a customer, which can be an account or contact.

And its structure is:

 { _parentcustomerid_value: Acoount.accountid, _parentcustomerid_type: "accounts"}

You could try this formula:

Filter(Contacts,_parentcustomerid_value in cmbAccount.Selected.accountid)

Here's doc for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/types-of-fields

https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/How-do-I-update-CDS-Contact-entity-parentcustomerid-type-and/m-p/107829?collapse_discussion=true&filter=location&location=forum-board:CDS_Apps&q=update%20CDS%20Contact%20company%20name&search_type=thread

 

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Tjelum
Level: Power Up

Re: Filtering Contacts on Parent Account using Combo box and Dropdown list

Hi, when I attempt to use the suggested filter formula I see an error on the _parentcustomerid_value field:

"Can't convert this data type.PowerApps can't convert this Polymorphic to a Text."

Do you have any suggestions?

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

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