cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MP_Squared
Helper I
Helper I

NEED Help! using a sortbycolumns and "with" function on a gallery

Hi, 

I need help being able to sort/search gallery columns using a textinput. This would normally be straight forward. But I'm using the "With" function to count the rows to make a banded row color. How do I use the With function with the sortbycolumns to still be able to search the database? This is my first go with the "with" function. 

 

Current formula on the gallery - 

With({records:'DataSource'},

ForAll(Sequence(CountRows(records)), Patch(Last(FirstN(records, Value)), {rowNumber:Value}))
)

 

Thanks for the help. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Community Champion
Community Champion

Hi @MP_Squared

 

Please let us know if anything needs on your post. We can help with this.

 

"Please do not forget to give kudos if you find the suggestion helpful or Accept it as a solution if works fine to help other users to find it useful. "

 

View solution in original post

4 REPLIES 4
StalinPonnusamy
Community Champion
Community Champion

Hi @MP_Squared 

 

 

 

Edited: This is edited one

 

 

With(
    {
        sData: Sort(
            Filter(
                BookCollection,
                StartsWith(
                    Author,
                    TextInput2.Text
                )
            ),
            BookName,
            Descending
        )
    },sData
)

 

Thanks for the quick Response @StalinPonnusamy , Should I wrap the for all at the end of the expression? 

StalinPonnusamy
Community Champion
Community Champion

Hi @MP_Squared 

 

This should work.  Please try this

With(
    {
        sData: Sort(
            Filter(
                BookCollection,
                StartsWith(
                    Author,
                    TextInput2.Text
                )
            ),
            BookName,
            Descending
        )
    },sData
)

 

StalinPonnusamy
Community Champion
Community Champion

Hi @MP_Squared

 

Please let us know if anything needs on your post. We can help with this.

 

"Please do not forget to give kudos if you find the suggestion helpful or Accept it as a solution if works fine to help other users to find it useful. "

 

View solution in original post

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,311)