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 to filter...
Power Automate
Answered

Filter array to filter out similar record based on date value

(1) ShareShare
ReportReport
Posted on by 823 Super User 2026 Season 1
Hello helpful people!
 
Can't figure out how to use an advanced filter expression to filter out records in this array when there is more than one record with the same store number.
I want to filter OUT the record that has "Promotion End Date" of '9999-12-31T00:00:00'.
So, in the screen shot below, I only want the first record with store number 7 as the second record has that date.
 
Appreciate any assistance! Thanks!
 
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    trice602 Profile Picture
    15,888 Super User 2026 Season 1 on at
    Hi,
     
    Please try and add a filter array where store number equal to 7.  Then add a condition where item()?['Store Number'] is equal to 7
     
    Then use a compose with the following first(body('Filter_array'))
     
    Then from there you can get specific fields such as Price by using outputs('Compose')?['Price']
     
     

    ------------------------------------------------

     

     

    ⭐ If this was helpful, please like and mark as a verified answer to help others find this too!

     

     

    Always glad to help! 💯💯💯💯💯

     

    Tom

     

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

  • Cgangweg01 Profile Picture
    823 Super User 2026 Season 1 on at
    thank you for the reply @trice602
     
    I think this is getting me close but refined the question. I need to find records in the array that have matching store numbers and filter out those with "Promotion End Date" = '9999-12-31T00:00:00'.
     
    Also, what does this expression do?
    first(body('Filter_array'))
     
    thanks!
  • Verified answer
    Cgangweg01 Profile Picture
    823 Super User 2026 Season 1 on at
    Hello,
     
    If anyone is following this post here is an update. 
     
    With help from outside the community I've got this advanced mode filter array query working.
     
    Here it is:
     
    not(and(greater(nthIndexOf(string(outputs('Filter_array_stores_with_future_specials')), string(item()?['Store Number']), 2), 0), equals(item()?['Promotion End Date'], '9999-12-31T00:00:00')))
     
    Not exactly sure how this nthIndexOf expression works but I need to tweak it. The store 45 record in the screenshot below is the only record in the From output with store number 45 and should not be filtered out even though it has promotion end date '9999-12-31T00:00:00'.
     
    Any ideas?
     
  • trice602 Profile Picture
    15,888 Super User 2026 Season 1 on at
    Hey there!
     
    I am following up on this post filter array to filter out similar record based on date value in this category building flows from 12/14/2024.  I know the post is a little older, but it is a common question here so wanted to take a moment and follow-up. I see there have been 3 replies and 1 likes and asking if your question has been answered.  If so, please help the community out by completing one or more of the following actions!  Thanks in advance!
     
    Easy as 1-2-3 ‼️💯⭐😎🆒🙏
     
    1) Mark a reply as a verified answer - this is essential, and it helps others with the same general question find this thread. ✅
    2) You can also mark one of more replies as a verified answer.  Please take a moment and give the author credit for volunteering their time. ✌️
    3) Like one or more replies.  Kudos always greatly appreciated! 👍
     
    Pro tip:  if you found your own solution or workaround, feel free to add a reply to your own post and mark it as the solution too!  The goal is to get this thread marked with a verified answer by anyone that finds one or more replies helpful!
     
    Again, thanks in advance for reading and responding, always glad to help!  Tom 💯💯💯💯💯
  • trice602 Profile Picture
    15,888 Super User 2026 Season 1 on at
    If I can help with anything else please let me know or tag me in a future post, I enjoy reading and answering questions.  Always glad to help!  Tom 💯💯💯💯💯

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 291 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 238 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 109 Super User 2026 Season 1

Last 30 days Overall leaderboard