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 / "Get items" filter two...
Power Automate
Unanswered

"Get items" filter two columns at once

(0) ShareShare
ReportReport
Posted on by

Hello!

 

I want to filter my SP list based on two conditions:

 

  • Machine Value = "ZT1"
  • Date = current day (in this case: 3/23/2023) 

In the Filter Query of the "Get Items" action, I inserted the following code:
Machine Value eq 'ZT1' and Date eq '@{convertTimeZone(utcNow(),'UTC', 'E. South America Standard Time')}'

 

But the following error appears for me when I run:

The expression "Machine Value eq 'ZT1' and Date eq '23/03/2023'" is not valid. Creating query failed.

How can I make this Filter Query filter these two columns at the same time correctly?

 

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    Your column name (Machine Value) has to be escaped.
    Probably to Machine_x0020_Value. Just check the output of the action.

  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    In addition to what @Chriddle said, you will have some issues with your date filter. Dates need to be in ISO8601 format, which would be yyyy-MM-dd as opposed to your dd/MM/yyyy format. The next issue is that it is unlikely that your Date field is going to equal (eq) the current date UTC datetime converted to the time zone specified.

     

    What you are most likely looking for are items where the date is the current date. To do that, you will want to use for the date portion of your filter query:

     

     

    Date ge convertTimeZone(startOfDay(utcNow()),'UTC','E. South America Standard Time') and Date lt addDays(convertTimeZone(startOfDay(utcNow()),'UTC','E. South America Standard Time'),1)

     

    This way it is looking for all items created between midnight of the current day and before midnight of the following day. When you pass you Date field in the filter query, it will include a date and time, so that makes it nearly impossible to ever use eq (equals).

     

    As long as your list item is a SharePoint date field, you really don't need to worry about using formatDateTime as by default it will pass the value in ISO8601 format. You'll only need to be concerned about it if you pass a text string formatted as you illustrated (23/03/2023).

  • Community Power Platform Member Profile Picture
    on at

    So my Filter Query should look like this?

    Machine_x0020_Value eq 'ZT1' and '@{Date ge convertTimeZone(startOfDay(utcNow()),'UTC','E. South America Standard Time') and Date lt addDays(convertTimeZone(startOfDay(utcNow()),'UTC' ,'E. South America Standard Time'),1)}'

     

  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    That looks correct to me... Of course, the only way to know will be to test it. 🙂

  • Community Power Platform Member Profile Picture
    on at

    Automate does not even let me create this expression:

    Date ge convertTimeZone(startOfDay(utcNow()),'UTC','E. South America Standard Time') and Date lt addDays(convertTimeZone(startOfDay(utcNow()),'UTC','E. South America Standard Time'),1)

     
    Could you please share the entire code that you created in a visual way?

  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    Here is an example form one of my flows:

    David_MA_0-1679600798406.png

    If your Filter query does not show the expressions in pink and you have the values you listed above in the filter query, that is your problem. You need to use the expression builder to build the expression and insert it into the Filter query.

     

    If that doesn't work, you will need to show what you are doing in your workflow.

     

    I tested the expressions I provided earlier and they work correctly:

    David_MA_1-1679601156709.png

     

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard