Skip to main content

Notifications

Power Automate - Building Flows
Answered

Unable to filter array after select action

(1) ShareShare
ReportReport
Posted on by 224
Hello -
 
I've used the filter array action with success before but I'm just not able to figure out this one.
I want to filter to just store number 3 and its price records after the Select action.
 
This does not work.
 
 
 
Any suggestions?
 
 
Select action output screen shot and snippet of output text below ...
 
 
 
Snippet of output ...
[
  {
    "StoreNumber": "1",
    "prices": [
      {
        "storePrice": 3.99,
        "quantity": 1,
        "startDateTime": "2024-03-18T00:00:00-04:00",
        "effectiveDateTime": "2024-03-18T00:00:00-04:00",
        "endDateTime": "9999-12-31T23:59:59.9999999+00:00",
        "effectiveEndDateTime": "9999-12-31T23:59:59.9999999+00:00"
      },
      {
        "storePrice": 4.49,
        "quantity": 1,
        "startDateTime": "2023-06-05T00:00:00-04:00",
        "effectiveDateTime": "2023-06-05T00:00:00-04:00",
        "endDateTime": "2024-03-17T23:59:59.9999999-04:00",
        "effectiveEndDateTime": "2024-03-17T23:59:59.9999999-04:00"
      }
    ]
  },
  {
    "StoreNumber": "3",
    "prices": [
      {
        "storePrice": 3.99,
        "quantity": 1,
        "startDateTime": "2025-03-01T00:00:00-05:00",
        "effectiveDateTime": "2025-03-01T00:00:00-05:00",
        "endDateTime": "9999-12-31T23:59:59.9999999+00:00",
        "effectiveEndDateTime": "9999-12-31T23:59:59.9999999+00:00"
      },
      {
        "storePrice": 3.45,
        "quantity": 1,
        "startDateTime": "2025-01-01T00:00:00-05:00",
        "effectiveDateTime": "2025-01-01T00:00:00-05:00",
        "endDateTime": "2025-02-28T23:59:59.9999999-05:00",
        "effectiveEndDateTime": "2025-02-28T23:59:59.9999999-05:00"
      },
      {
        "storePrice": 3.99,
        "quantity": 1,
        "startDateTime": "2024-03-18T00:00:00-04:00",
        "effectiveDateTime": "2024-03-18T00:00:00-04:00",
        "endDateTime": "2024-12-31T23:59:59.9999999-05:00",
        "effectiveEndDateTime": "2024-12-31T23:59:59.9999999-05:00"
      },
      {
        "storePrice": 4.49,
        "quantity": 1,
        "startDateTime": "2023-06-05T00:00:00-04:00",
        "effectiveDateTime": "2023-06-05T00:00:00-04:00",
        "endDateTime": "2024-03-17T23:59:59.9999999-04:00",
        "effectiveEndDateTime": "2024-03-17T23:59:59.9999999-04:00"
      }
    ]
  },
  {
    "StoreNumber": "4",
    "prices": [
      {
        "storePrice": 3.99,
        "quantity": 1,
        "startDateTime": "2024-03-18T00:00:00-04:00",
        "effectiveDateTime": "2024-03-18T00:00:00-04:00",
        "endDateTime": "9999-12-31T23:59:59.9999999+00:00",
        "effectiveEndDateTime": "9999-12-31T23:59:59.9999999+00:00"
      },
      {
        "storePrice": 4.49,
        "quantity": 1,
        "startDateTime": "2023-06-05T00:00:00-04:00",
        "effectiveDateTime": "2023-06-05T00:00:00-04:00",
        "endDateTime": "2024-03-17T23:59:59.9999999-04:00",
        "effectiveEndDateTime": "2024-03-17T23:59:59.9999999-04:00"
      }
    ]
  },
 
Thanks!
  • Cgangweg01 Profile Picture
    Cgangweg01 224 on at
    Unable to filter array after select action
    Hello!
     
     
    Thank you both so much. This worked, int(item()?['StoreNumber']. Why did it work? Does it change the field I'm querying for into an integer?
     
    Next, I need to figure out how to filter for specific prices for the store in the result below? Probably by dates equal to something or not equal to something.
     
    Anyway ... have you noticed something wrong with notifications with this community site? I never got a notification of your reply post HJL nor do I get notifications to other people's posts that I subscribe to. Becoming less valuable.
     
     
     
    {
        "body": [
            {
                "StoreNumber": "3",
                "prices": [
                    {
                        "storePrice": 3.99,
                        "quantity": 1,
                        "startDateTime": "2025-03-01T00:00:00-05:00",
                        "effectiveDateTime": "2025-03-01T00:00:00-05:00",
                        "endDateTime": "9999-12-31T23:59:59.9999999+00:00",
                        "effectiveEndDateTime": "9999-12-31T23:59:59.9999999+00:00"
                    },
                    {
                        "storePrice": 3.45,
                        "quantity": 1,
                        "startDateTime": "2025-01-01T00:00:00-05:00",
                        "effectiveDateTime": "2025-01-01T00:00:00-05:00",
                        "endDateTime": "2025-02-28T23:59:59.9999999-05:00",
                        "effectiveEndDateTime": "2025-02-28T23:59:59.9999999-05:00"
                    },
                    {
                        "storePrice": 3.99,
                        "quantity": 1,
                        "startDateTime": "2024-03-18T00:00:00-04:00",
                        "effectiveDateTime": "2024-03-18T00:00:00-04:00",
                        "endDateTime": "2024-12-31T23:59:59.9999999-05:00",
                        "effectiveEndDateTime": "2024-12-31T23:59:59.9999999-05:00"
                    },
                    {
                        "storePrice": 4.49,
                        "quantity": 1,
                        "startDateTime": "2023-06-05T00:00:00-04:00",
                        "effectiveDateTime": "2023-06-05T00:00:00-04:00",
                        "endDateTime": "2024-03-17T23:59:59.9999999-04:00",
                        "effectiveEndDateTime": "2024-03-17T23:59:59.9999999-04:00"
                    }
                ]
            }
        ]
    }
     
     
  • Verified answer
    HJL Profile Picture
    HJL 7 on at
    Unable to filter array after select action
    Looks like StoreNumber is actually stored as a string. Try this:
    int(item()?['StoreNumber'])
  • Cgangweg01 Profile Picture
    Cgangweg01 224 on at
    Unable to filter array after select action
    Hello @bscarlavai33 
     
    Thank you for the reply post.
     
    I tried your suggestion, and it didn't work. I tried a few variations with the ? in the expression and changing case of the storenumber string based on something that I see before the select action but still nothing works.
     
    Below is what I attempted.
    Any suggestion now?
     
    Appreciate it!
     
     
     
  • Suggested answer
    bscarlavai33 Profile Picture
    bscarlavai33 513 on at
    Unable to filter array after select action
    Use the expression item()['StoreNumber'] instead of just StoreNumber in your Filter Query. That should work.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard