web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / OData filter for lookup.
Power Automate
Unanswered

OData filter for lookup.

(1) ShareShare
ReportReport
Posted on by 21

Hello,

Is it possible to filter the rows in power automate with lookup values? The value must be from the lookup table.

Following are the screenshots of the two tables from the dataverse.

table to filter.table to filter.the lookup table.the lookup table.

 

From the lookup column of the 'rsp_table', I want to filter the orders with the specific table which is represented by rsp_count in the rsp_table.

Categories:
I have the same question (0)
  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @RoshanShrestha 

    First you need to get the lookup table value filtered by count using List Rows and ODATA Filter similar to the below

    rsp_count eq 'Your Value'

    Then use the first value from the returned array to get the value from the table to filter

    Steps similar to below:

    1. Get the value from the lookup table based on count

    Mira_Ghaly_2-1643537025550.png

     

    Mira_Ghaly_0-1643536808874.png

     

    2. Use the first returned item from your list ..it should return only 1 record I assume and use it to filter the Table to filter as below:

     

    Mira_Ghaly_1-1643536917073.png

    Mira_Ghaly_3-1643537086842.png

    Right Hand Side Expression:

    first(outputs('List_rows')?['body/value'])['cr2d2_lookuptableid']

    Please note how to use the lookup column name in the ODATA Filter it should be in the format _NAME_Value

     

    Please reach out if this is unclear or you need more help with that!

     

  • RoshanShrestha Profile Picture
    21 on at

    This solution took a extra process or step. What I was looking for is filtering the required table with lookup table with other column value at single step if it's possible.

    Example: filter list rows with given query as _cdr2lookupcolumn_othercolumn.

    Here, cdr2lookupcolumn is the lookup column for the required table and other column is the column of that lookup table.

  • Verified answer
    Mira Ghaly Profile Picture
    11,413 Moderator on at

    @RoshanShrestha 

    According to my knowledge this needs to be done in 2 steps as shown; It is not possible to achieve this in one step.

     

  • RoshanShrestha Profile Picture
    21 on at

    Thank you so much! I was just looking if there is an alternative.

  • Casper Profile Picture
    41 on at

    I have a similar problem.

     

    The error

    Could not find a property named '_cj_employee_value_' on type 'Microsoft.Dynamics.CRM.cj_gmaemployeesalary'.

     

    Decsus_0-1665040699220.png

    I get the ID from the trigger (when row is modified) from Tabel Building Employee

     

    I then want to filter for all the rows in Employee Salary that have that id, cj_Employee is the lookup table.

     

    I have used both this name 

    Decsus_1-1665040946071.png

    and the logical name, thus both

    _cj_employee_value_

    and

    _cj_Employee_value_

    but I keep getting this

     

    cj_gmaemployeesalaryid is the Unique identifier

     

  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @Decsus 

     

    can you please share how your tables looks like?

     

  • Casper Profile Picture
    41 on at

    These are the two tables

    Decsus_1-1665044646065.png

    Decsus_2-1665044669399.png

     

  • Ian_UK Profile Picture
    2 on at

    I do this by using an XML query.

     

    Then you need to populate the GUID and Name from the 2nd table.

     

    This means you first need a 'get a Row' to the 2nd table to get the Name of the lookup value.

     

    The XML query can be got very easily from a view in the user interface with a suitable filter applied as an example. Then replace the example filter ID and Name with the ones you need.

  • NathanDG Profile Picture
    14 on at

    Hi @Ian_UK ,

     

    Working with an OData Filter will work in one-step as you initially asked. This is what is needed to be done :

     

    1. Locate your lookup field in a request body (I used a List Rows action to analyse the body)

    My LookUp column is "ActivitiesData" :

    NathanDG_0-1707230583682.png

    What we want is the "_ca2div_activitiesdata_value"

     

    2. Change your OData filter

    If the LookUp field is empty, that value will be null, so we can do an easy filter for this like this :

    _ca2div_activitiesdata_value eq null

    to only retrieve the rows that have an empty lookup field 🙂

     

    If it worked for you please mark this as the solution so it can help others.

     

    Have a great day!

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard