cancel
Showing results for
Did you mean:
Frequent Visitor

## Filter array base multiple filters

I am able to create the array

I need to filter the results based on 2 fields, Less than FromFSC and greater than ToFSC

Problem1: If I just use GreaterThen than FromFSC   @greater(4.71, items('Apply_to_each')?['field_0'])

The whole table is returned even if FromFSC is less then 4.71

Problem2 : Same thing for the LessThen ToFSC   @Less(4.71, items('Apply_to_each')?['field_0'])

Problem3: I know what Im trying to do isnt complicated, What am I doing stupid?

Below is the output generated

 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29

And this is my list

FromFSC       ToFsc            FSCratee
 1.5 1.74 0.03 1.75 1.99 0.04 2 2.19 0.05 2.2 2.39 0.06 2.4 2.55 0.07 2.56 2.7 0.08 2.71 2.85 0.09 2.86 3 0.1 3.01 3.1 0.11 3.11 3.2 0.12 3.21 3.3 0.13 3.31 3.4 0.14 3.41 3.5 0.15 3.51 3.6 0.16 3.61 3.7 0.17 3.71 3.8 0.18 3.81 3.9 0.19 3.91 4 0.2 4.01 4.1 0.21 4.11 4.2 0.22 4.21 4.3 0.23 4.31 4.4 0.24 4.41 4.5 0.25 4.51 4.6 0.26 4.61 4.7 0.27 4.71 4.8 0.28 4.81 4.9 0.29 4.91 5 0.3

1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Visitor

Thanks P, I dont think I went into enough detail with what I was trying to do. I involved to lists.

I will accpt as a solution for your time.

I will open a new ticket with greater detail.

7 REPLIES 7
Most Valuable Professional

The condition you are looking for in the filter array would be something like this

``@And(less(item()?['FromFSC'], 4.71),greater(item()?['ToFSC'], 4.71))``

-------------------------------------------------------------------------
If you like my response, please give it a Thumbs Up.
Frequent Visitor

Hello again P,

Made the change and this is the error I got.

The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@And(less(item()?['FromFSC'], 4.71),greater(item()?['ToFSC'], 4.71)) ' failed: 'The template language function 'less' expects all of its parameters to be either integer or decimal numbers. Found invalid parameter types: 'Null'.'

Most Valuable Professional

That error is suggesting one of the values being tested is coming in as a null value. Check your data to make sure there are actual numbers in all the records. Its either that or the reference to the columns isn't correct.

-------------------------------------------------------------------------
If you like my response, please give it a Thumbs Up.
Frequent Visitor

I have checked each column in the list using "the filter by" and the were no nulls or blanks showing.

I even exported the list to excel, I dont see any blanks.,and columns seem to be correct.

Title         FromFSC ToFsc     FSCrate

 0.03 1.5 1.74 0.03 0.04 1.75 1.99 0.04 0.05 2 2.19 0.05 0.06 2.2 2.39 0.06 0.07 2.4 2.55 0.07 0.08 2.56 2.7 0.08 0.09 2.71 2.85 0.09 0.1 2.86 3 0.1 0.11 3.01 3.1 0.11 0.12 3.11 3.2 0.12 0.13 3.21 3.3 0.13 0.14 3.31 3.4 0.14 0.15 3.41 3.5 0.15 0.16 3.51 3.6 0.16 0.17 3.61 3.7 0.17 0.18 3.71 3.8 0.18 0.19 3.81 3.9 0.19 0.2 3.91 4 0.2 0.21 4.01 4.1 0.21 0.22 4.11 4.2 0.22 0.23 4.21 4.3 0.23 0.24 4.31 4.4 0.24 0.25 4.41 4.5 0.25 0.26 4.51 4.6 0.26 0.27 4.61 4.7 0.27 0.28 4.71 4.8 0.28 0.29 4.81 4.9 0.29
Frequent Visitor

And column names seem to be correct

Most Valuable Professional

Column names are case sensitive.  You reported the query as

``@And(less(item()?['FromFSC'], 4.71),greater(item()?['ToFSC'], 4.71))``

ToFSC is ToFsc in the list you posted.

-------------------------------------------------------------------------
If you like my response, please give it a Thumbs Up.
Frequent Visitor

Thanks P, I dont think I went into enough detail with what I was trying to do. I involved to lists.

I will accpt as a solution for your time.

I will open a new ticket with greater detail.

Announcements

#### Tuesday Tip | How to Get Community Support

It's time for another Tuesday Tip, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.       This Week: All About Community Support Whether you're a seasoned community veteran or just getting started, you may need a bit of help from time to time! If you need to share feedback with the Community Engagement team about the community or are looking for ways we can assist you with user groups, events, or something else, Community Support is the place to start.   Community Support is part of every one of our communities, accessible to all our community members.   Within each community's Community Support page, you'll find three distinct areas, each with a different focus to help you when you need support from us most. Power Apps: https://powerusers.microsoft.com/t5/Community-Support/ct-p/pa_community_support Power Automate: https://powerusers.microsoft.com/t5/Community-Support/ct-p/mpa_community_support Power Pages: https://powerusers.microsoft.com/t5/Community-Support/ct-p/mpp_community_support Copilot Studio: https://powerusers.microsoft.com/t5/Community-Support/ct-p/pva_community-support   Community Support Form If you need more assistance, you can reach out to the Community Team via the Community support form. Choose the type of support you require and fill in the form accordingly. We will respond to you promptly.    Thank you for being an active part of our community. Your contributions make a difference!   Best Regards, The Community Management Team

#### Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp