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
Highlighted
Community Support
Community Support

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

4 REPLIES 4
Highlighted
Community Support
Community Support

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

Highlighted
New Member

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?

Highlighted
New Member

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

I have the same question. Did you ever find a working solution for this?

Highlighted
New Member

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

Got the same issue here, no solution.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,474)