web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter string in gallery
Power Apps
Answered

Filter string in gallery

(0) ShareShare
ReportReport
Posted on by

Hi guys,

 

Today i have a great challenge that i´ve been dealing all day. So i have this string "1.0.0, 2.0.0" and "2.2.2" which is part of a large set of Data that is displayed in a gallery. Each comma separated value is one element and each element period separated is one level. I want to be able to select the first level and put "2" in the input so that both "1.0.0, 2.0.0" and "2.2.2" appear in my filtered gallery. Right now if i select the first level with 2 in input, only the second value appears. 

 

Can anyone give me some guidance? Thank you for the time ^^

 

User7_0-1629392000147.png

 

Categories:
I have the same question (0)
  • KBilakanti1 Profile Picture
    Microsoft Employee on at

    @User7 

     

    You can use Search function, to match your requirement.

    KBilakanti1_0-1629458125630.png

    Sample Collection:
    Collect(ColItems,{Level:"1.0.0,2.0.0"},{Level:"2.2.2"},{Level:"1.0.0,3.0.0"});
    
    Logic on Gallery Items property:
    Search(ColItems, TextInput3.Text,"Level")

     

  • Verified answer
    HS-02011419-0 Profile Picture
    on at

    Hi @KBilakanti1 ,

     

    today i already got the solution for my problem ^^ . your approach is not what i am looking for maybe because i didnt explain correctly. 

     

    Picking your example:

    Sample Collection:
    Collect(ColItems,{Item:"1.0.0,2.0.0"},{Item:"2.2.2"},{Item:"1.0.0,3.0.0"});

     Each item can have one or more values separated by comma. (Value example: '1.0.0')

    Each value has one or more levels. (Example with value '1.0.0': Level 1 - '1' ; Level 2 - '0'; Level 3 - '0').

    I wanted to be able to search in every value in specific level, so that:

    • when i search for '2' in the first level only the the two first items of my collection will appear.
    • If i search for '0' in the third level, only the first and last items from my collection will appear.

     

    With this being said. Here the solution i found.

    • This is inside an Or().
    • "txtPesquisaAssuntos" is my input.
    • I´m assuming there is no more than 10 values for each item. So i repeated this code 10 times changing only the index.

    For each element of an Item im going to pick up the value of the level that i want to search with a maximum of 10 elements per item.

    txtPesquisaAssuntos.Text in Last(
     FirstN(
     Split(
     Last(
     FirstN(
     Split(
     ThisRecord.Item,
     ","
     ),
     1 //This represents the position of the value, int this case '1.0.0'
     )
     ).Result,
     "."
     ),
     Value(ddFilterByWBSLevel.Selected.Value) //This is the DropDown that selects the level where i want to search
     )
     ).Result

    An that´s how i´ve done it!

     

    Thanks for the time spent on trying to help me ^^

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 88

#2
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 45

Last 30 days Overall leaderboard