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
Regular Visitor

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,178)