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
Multi Super User

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'.'

Multi Super User

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

Multi Super User

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

#### Announcing | Super Users - 2023 Season 1

Super Users – 2023 Season 1    We are excited to kick off the Power Users Super User Program for 2023 - Season 1.  The Power Platform Super Users have done an amazing job in keeping the Power Platform communities helpful, accurate and responsive. We would like to send these amazing folks a big THANK YOU for their efforts.      Super User Season 1 | Contributions July 1, 2022 – December 31, 2022  Super User Season 2 | Contributions January 1, 2023 – June 30, 2023    Curious what a Super User is? Super Users are especially active community members who are eager to help others with their community questions. There are 2 Super User seasons in a year, and we monitor the community for new potential Super Users at the end of each season. Super Users are recognized in the community with both a rank name and icon next to their username, and a seasonal badge on their profile.  Power Apps  Power Automate  Power Virtual Agents  Power Pages  Pstork1*  Pstork1*  Pstork1*  OliverRodrigues  BCBuizer  Expiscornovus*  Expiscornovus*  ragavanrajan  AhmedSalih  grantjenkins  renatoromao    Mira_Ghaly*  Mira_Ghaly*      Sundeep_Malik*  Sundeep_Malik*      SudeepGhatakNZ*  SudeepGhatakNZ*      StretchFredrik*  StretchFredrik*      365-Assist*  365-Assist*      cha_cha  ekarim2020      timl  Hardesh15      iAm_ManCat  annajhaveri      SebS  Rhiassuring      LaurensM  abm      TheRobRush  Ankesh_49      WiZey  lbendlin      Nogueira1306  Kaif_Siddique      victorcp  RobElliott      dpoggemann  srduval      SBax  CFernandes      Roverandom  schwibach      Akser  CraigStewart      PowerRanger  MichaelAnnis      subsguts  David_MA      EricRegnier  edgonzales      zmansuri  GeorgiosG      ChrisPiasecki  ryule      AmDev  fchopo      phipps0218  tom_riha      theapurva  takolota     Akash17  momlo     BCLS776  Shuvam-rpa     rampprakash  ScottShearer     Rusk  ChristianAbata     cchannon  Koen5     a33ik  Heartholme     AaronKnox  okeks      Matren   David_MA     Alex_10        Jeff_Thorpe        poweractivate        Ramole        DianaBirkelbach        DavidZoon        AJ_Z        PriyankaGeethik        BrianS        StalinPonnusamy        HamidBee        CNT        Anonymous_Hippo        Anchov        KeithAtherton        alaabitar        Tolu_Victor        KRider        sperry1625        IPC_ahaas      zuurg    rubin_boer   cwebb365   Dorrinda   G1124   Gabibalaban   Manan-Malhotra   jcfDaniel   WarrenBelz   Waegemma   drrickryp   GuidoPreite    If an * is at the end of a user's name this means they are a Multi Super User, in more than one community. Please note this is not the final list, as we are pending a few acceptances.  Once they are received the list will be updated.