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 / Filter array based on ...
Power Automate
Unanswered

Filter array based on two dates

(0) ShareShare
ReportReport
Posted on by 31

I am wanting to pull a data set of feedback for an individual user. The power Automate script already goes into the spreadsheet and pulls out only the individual users data, but it is collecting ALL their feedback. So I am using an MS form to specify the start date of the feedback and the end date of the feedback requested.

 

How can I filter the array so that only the feedback that falls between the two inputted dates is sent to the user and not the whole data set?

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @JoelMills,

    I guess that you need a filter operation with filter used in "Edit in advanced mode":

    gabibalaban_1-1645734190114.png

    and adapt the following formula to your needs:  

    @and(
     less(ticks('FormStartDate'), ticks(item()['DateColumn'])),
     greater(ticks('FormEndDate'), ticks(item()['DateColumn'])
    )

     The result should be all the items from array with DateColumn between FormStartDate and FormEndDate.

     

    Hope it helps !

  • JoelMills Profile Picture
    31 on at

    The problem is my Parse JSON query is picking up the date as a string even though the date format in the spreadsheet is set to date....

    "Start Date": {
    "type": "string"
    },
     
    And it said my expression was wrong in the filter array when I tried to apply it to the array fetched from the table.
  • JoelMills Profile Picture
    31 on at

    Any further suggestions please?

    I have tried adding this into the advance mode on a Filter Array:

    @And(less(ticks('StartDate'), ticks(item()['Simple date'])), greater(ticks('EndDate'), ticks(item()['Simple date']))

    but it generates an error in the flow checker...."Invalid expression"... (it keeps changing the "@ and" to @And in my post... sorry...) 

     

     

    "StartDate" and "EndDate" are the names of the columns in the form that the user submits to request their feedback period from and to.

    "Simple date" is the column heading in the data source that I am trying to filter out results from based on those two input dates...

  • JoelMills Profile Picture
    31 on at

    @abm @ericonline 
    Can you help with this please????
    WHy is this so hard?
    Input from the user is two dates.... StartDate & EndDate

    Data set in spreadsheet has a date column which is retrieved as 2021-11-23T11:02:19.000Z

     

    All I want to do is filter out all results that fall outside the StartDate and EndDate....

    I have gone round and round in circles looking at the JSON schema, expressions in Compose items, Filter Array and I am getting no closer to a solution... Please help as I am ready to give up...!

  • JoelMills Profile Picture
    31 on at

    Can anyone help with this please?

     

    I was hoping the community could support me to achieve this...

  • VictorIvanidze Profile Picture
    13,073 on at

    Show your flow.

  • JoelMills Profile Picture
    31 on at

    Screenshot 2022-04-07 at 15.54.09.pngScreenshot 2022-04-07 at 15.58.29.png

  • JoelMills Profile Picture
    31 on at

    The above simply returns ALL entires for the user who submits the request form...

    The request form (MS Form) has two fields.. start date (when you want to get data from) and end date (When you want the data until)...

    Those dates are fed into the flow and trigger it... and then the flow interrogates the data set and would only return rows with dates between those two dates.

     

  • JoelMills Profile Picture
    31 on at

    Posted screenshots and what I am needing to do. Hope you can help a bit...

  • VictorIvanidze Profile Picture
    13,073 on at

    Could you also show "Filter on email" expanded?

     

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard