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 / Find records in the ar...
Power Automate
Unanswered

Find records in the array that match on a value and filter out those with a certain date value

(0) ShareShare
ReportReport
Posted on by 789 Super User 2025 Season 2
Hello -
 
Having trouble figuring out how to filter for the following. Trying to find records in the array that have matching store numbers and of that set filter out those with "Promotion End Date" = '9999-12-31T00:00:00'.  There can be numerous sets of records with the same store number in the parsed JSON input.
 
Here is sample of the data. In this sample there are 5 records. After the filter(s) run there should only be 4 records with the third store number 55 record filtered out.
 
 {
            "Store Number": 45,
            "Store Name": "abc",
            "Price": 4.44,
            "Price Type": "STORE",
            "Price Start Date": "2025-01-01T00:00:00",
            "Promotion Type": null,
            "Promotional Price": 4.44,
            "Promotion Start Date": "2025-01-01T00:00:00",
            "Promotion End Date": "9999-12-31T00:00:00",
            "Coupon Number": null,
            "Price Status": "FUT"
        },
        {
            "Store Number": 55,
            "Store Name": "xyz",
            "Price": 1.11,
            "Price Type": "STORE",
            "Price Start Date": "2025-02-03T00:00:00",
            "Promotion Type": "M",
            "Promotional Price": 1.11,
            "Promotion Start Date": "2025-02-03T00:00:00",
            "Promotion End Date": "2025-02-28T00:00:00",
            "Coupon Number": null,
            "Price Status": "FUT"
        },
        {
            "Store Number": 55,
            "Store Name": "xyz",
            "Price": 2.22,
            "Price Type": "STORE",
            "Price Start Date": "2025-01-06T00:00:00",
            "Promotion Type": null,
            "Promotional Price": 2.22,
            "Promotion Start Date": "2025-01-06T00:00:00",
            "Promotion End Date": "2025-02-02T00:00:00",
            "Coupon Number": null,
            "Price Status": "FUT"
        },
        {
            "Store Number": 55,
            "Store Name": "xyz",
            "Price": 2.22,
            "Price Type": "STORE",
            "Price Start Date": "2025-03-01T00:00:00",
            "Promotion Type": null,
            "Promotional Price": 2.22,
            "Promotion Start Date": "2025-03-01T00:00:00",
            "Promotion End Date": "9999-12-31T00:00:00",
            "Coupon Number": null,
            "Price Status": "FUT"
        },
        {
            "Store Number": 129,
            "Store Name": "def",
            "Price": 0,
            "Price Type": "STORE",
            "Price Start Date": "2025-01-01T00:00:00",
            "Promotion Type": null,
            "Promotional Price": 0,
            "Promotion Start Date": "2025-01-01T00:00:00",
            "Promotion End Date": "9999-12-31T00:00:00",
            "Coupon Number": null,
            "Price Status": "FUT"
        }
 
Appreciate any assistance.
Thanks!
 
 
Categories:
I have the same question (0)
  • Cgangweg01 Profile Picture
    789 Super User 2025 Season 2 on at
    Hi!
     
    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?
     
     

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
David_MA Profile Picture

David_MA 245 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 207 Most Valuable Professional

#3
trice602 Profile Picture

trice602 190 Super User 2025 Season 2

Last 30 days Overall leaderboard