cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
D365_Eric
Helper V
Helper V

How to filter rows with lookup column in Dataverse

Hello Community,

 

I have been trying to figure out how to set the filter query in the List Rows action in Dataverse, to only get the related records from the same parent lookup. As an example, for each Account, we have multiple child Contacts associated with the same parent account record (i.e. having the account as the lookup on the contact).

 

In the Power Automate flow, I use the List Rows action to first get all the accounts in Dataverse, and then use "Apply to each" operation to loop through each account. For each loop, I want to use the List Rows action to get all the related contact records associated with the same account via the account lookup. How can I define that filter query so that the List Rows action in each loop returns only the list of related contacts for the same account lookup, as we loop through each account?

 

D365_Eric_1-1655358197696.png

Any insights would be greatly appreciated!

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Rose2022
New Member

You should use _parentcustomerid_value which holds a numerical value of the accountid. Hope it works! 

View solution in original post

5 REPLIES 5
StretchFredrik
Resolver I
Resolver I

{ColumnName} eq '{YourDynamicData}'

Hi @StretchFredrik ,

 

Thanks for your reply. I tried the following, however it's not working. It gives me the following error:

 

Did I miss anything in terms of syntax?

D365_Eric_0-1655382090844.png

D365_Eric_1-1655382178428.png

 

StretchFredrik
Resolver I
Resolver I

The column doest exist, are you taking the "backend" name of the column? I usually get this by looking at the API call and seeing what the internal name for the field is. 

Hi @StretchFredrik ,

 

Yes, in this case, in the filter condition, I am putting parentcustomerid eq 'Account' (Account being the Dynamic Data). The field "parentcustomerid" is the out of the box internal name of the lookup field to Account on the Contact entity. Not sure why it's complaining the field doesn't exist because it's definitely there... 

Rose2022
New Member

You should use _parentcustomerid_value which holds a numerical value of the accountid. Hope it works! 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,054)