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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,557)