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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter Json Array with...
Power Automate
Unanswered

Filter Json Array with Power Automate

(0) ShareShare
ReportReport
Posted on by 28

Hi All, 

 

I am getting below Json array and want to filter values. 

 

[{
   
    "start": {
      "dateTime""2022-07-29T07:00:00.0000000",
      "timeZone""UTC"
    },
    "end": {
      "dateTime""2022-07-29T07:30:00.0000000",
      "timeZone""UTC"
    }
]
 
I used below query to filter the date time time value with current date but its not returning any data. 
 
item()?['start']?['datetime']
 
 
how we use filter query for getting the values. 
 
Categories:
I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @ndpro 

     

    In your example you have an array with a single object containing a start and end object.  Whilst you can call the start and end object by key name, the main object {} needs to be called by integer index or by using the first() expression.  Item is generally used within a loop / apply to each or select.

     

    But based on what is visible in your question, this should work:

     

    first(item())?['start']?['datetime']

    OR

    item()?[0]?['start']?['datetime']


    Cheers
    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts. Thanks

     

     

  • ndpro Profile Picture
    28 on at

    @DamoBird365  Thanks for quick response. 

     

    I am not having single object and its containing more than 100 objects. I copied only single object in array. I need to filter whole json file with start datetime with current date.

     

    [{
       
        "start": {
          "dateTime""2022-07-29T07:00:00.0000000",
          "timeZone""UTC"
        },
        "end": {
          "dateTime""2022-07-29T07:30:00.0000000",
          "timeZone""UTC"
        }
    },
    {
       
        "start": {
          "dateTime""2022-07-29T07:00:00.0000000",
          "timeZone""UTC"
        },
        "end": {
          "dateTime""2022-07-29T07:30:00.0000000",
          "timeZone""UTC"
        }
    },
    {
       
        "start": {
          "dateTime""2022-07-29T07:00:00.0000000",
          "timeZone""UTC"
        },
        "end": {
          "dateTime""2022-07-29T07:30:00.0000000",
          "timeZone""UTC"
        }
    },
    ]

     

  • VictorIvanidze Profile Picture
    13,079 on at

    Have a look at this: https://chercher.tech/power-automate/handling-json-files-power-automate

  • ndpro Profile Picture
    28 on at

    @VictorIvanidze  I am having same solution for my power automate to filter. its just working only with below type of date time not with my json which i mentioned in above comments 

     

     

    {

    "date":"datetime"

     

    }

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @ndpro 

     

    You can use a select to repurpose your array and provide an output as follows:

     

    DamoBird365_0-1661500553705.png

     

    I have put your array into a compose (you have a spare , after the last object which I have remove and then I have created the following select:

     

    DamoBird365_1-1661500616865.png

     

    item()?['start/datetime']

    item()?['end/datetime']

     

    If you want to filter on the original array, you can do the following:

     

    DamoBird365_2-1661502369480.png

    I updated the three start dates to 27,28 and 29 and the output was 2 of the 3 objects based on the above filter.


    Cheers
    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts. Thanks

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    @ndpro of course you might just be looking for a way to format the current date? 

    formatDateTime(utcNow(),'yyyy-MM-dd') so that it is the same format as the date in your array.
     
    Damien

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard