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 List Rows filter...
Power Automate
Unanswered

ODATA List Rows filter query of Dataverse table help please

(0) ShareShare
ReportReport
Posted on by

I have been wrestling with crafting a query that works. The Flow must accept the field data coming from a button-triggered Flow in a Canvas app--the "FILTERS" panel on the right of the pic.

Surely the "Filter rows" ODATA is able to manage so complex a query. So, it must be my inexperience. Can someone help please?

ChrisChong_1-1689478264195.png

Chris

Categories:
I have the same question (0)
  • GdarmonAbra Profile Picture
    77 on at

    using Odata filters in Power automate should look like this

    for string:

    fieldName Operation 'Value'

    for int:

    fieldName Operation numericValue

     

    List Of Operations

    GdarmonAbra_0-1689488660190.png

     

  • Linn Zaw Win Profile Picture
    2,996 on at

    @ChrisChong 

    Filtering with a fixed number of parameters is not complex. You can use contains operator for searching for a substring, eq operator for exact match, single quotes around string values, etc.

    contains(cra31_lastname, 'David') and cra31_region eq 60100012

    But it can get complicated if the search parameter is dynamic and if you need to build your filter rows parameter only based on the Filters entered by the user. (e.g. the user enters Facility, Last Name and Region but leaves the other filters empty).

    In that case, I recommend using Compose steps to build your Filter Rows parameter first.

    In the example below, the following expression concatenates the Facility, City, Last Name and Region field names with the parameter values if the parameter value is not null.

    concat
    (
    	if
    	(
    		equals(triggerBody()?['text'], null),
    		'',
    		concat
    		(
    			'contains(cra31_facility, ''',
    			triggerBody()['text'],
    			''') and '
    		)
    	),
    	if
    	(
    		equals(triggerBody()?['text_1'], null),
    		'',
    		concat
    		(
    			'contains(cra31_city, ''',
    			triggerBody()['text_1'],
    			''') and '
    		)
    	),
    	if
    	(
    		equals(triggerBody()?['text_2'], null),
    		'',
    		concat
    		(
    			'contains(cra31_lastname, ''',
    			triggerBody()['text_2'],
    			''') and '
    		)
    	),
    	if
    	(
    		equals(triggerBody()?['text_3'], null),
    		'',
    		concat
    		(
    			'cra31_region eq ',
    			triggerBody()['text_3'],
    			' and '
    		)
    	)
    )

     

    The expression above will have an extra " and " at the end, so you might need another Compose step to truncate the last x5 characters.

    if
    (
     empty(outputs('Compose')),
     '',
     substring(outputs('Compose'),0,sub(length(outputs('Compose')),5))
    )

     

    The end result will look something like this. (Facility, Last Name and Region values were entered but the City was empty).

    contains(cra31_facility, 'Power') and contains(cra31_lastname, 'David') and cra31_region eq 60100012

    LinnZawWin_0-1689637901812.png

     

     

     

  • ChrisChong Profile Picture
    on at

    Thank you. I think I can follow the concept in your suggestion. As you say, it gets complicated because the "Filter rows" search parameters are supplied dynamically. I will give it a go using the "Compose" step. I may be back if stuck. I hope you don't mind. I appreciate your patient response.

    Chris

  • Linn Zaw Win Profile Picture
    2,996 on at

    @ChrisChong 

    How did it go with using the "Compose" step? Feel free to let me know if you get stuck with your solution.

     

     

     

  • ChrisChong Profile Picture
    on at

    Unfortunately, I've not implemented your ideas yet--just the crush of other work. This week, I get back to it.

    Thanks for your interest.

    Chris

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard