cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gennarodp
Post Patron
Post Patron

Search in gallery with multiple fields

Hello, 

i have a powerapp with a Gallery of a sharepoint list.

 

This gallery has the following fields:

 

Work Center

Date

Title

 

The "Item" setting of gallery is the following formula:

SortByColumns(Filter([@'Test'], StartsWith('Title', TextSearchBox1.Text)), "Title"; If(SortDescending1, Descending, Ascending))

 

I would like to have the possibility to search fields with a TexSearchBox, not only with Title, but also with Work Center Value, and with IconSortUpDown to order those fields in order of Date Value.

 

How can i do this ?

 

Thank you all

 

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User II
Super User II

Hi @gennarodp 

 

 

 

SortByColumns(
    Filter(
        [@'Test'],
        StartsWith(
            Title,
            TextSearchBox1.Text
        ) || StartsWith(
            'Work Center',
            TextSearchBox1.Text
        )
    ),
    "Date",
    If(
        SortDescending1,
        Descending,
        Ascending
    )
)

 

 

 

Unless I am mistaken, in your formula above, there should be a "," after "Title" not a semicolon before the If( .

Also FYI, Date is a reserved word and can cause ambiguities.  You should name your column in SharePoint something else like "DateEntered"

View solution in original post

7 REPLIES 7
Drrickryp
Super User II
Super User II

Hi @gennarodp 

 

 

 

SortByColumns(
    Filter(
        [@'Test'],
        StartsWith(
            Title,
            TextSearchBox1.Text
        ) || StartsWith(
            'Work Center',
            TextSearchBox1.Text
        )
    ),
    "Date",
    If(
        SortDescending1,
        Descending,
        Ascending
    )
)

 

 

 

Unless I am mistaken, in your formula above, there should be a "," after "Title" not a semicolon before the If( .

Also FYI, Date is a reserved word and can cause ambiguities.  You should name your column in SharePoint something else like "DateEntered"

View solution in original post

Yes, there is ",", my mistake.

 

Your formula doesn't work 😞

 

 

@gennarodp 

Please post the error you are getting. or a screenshot showing it. If it doesn't work, I'm guessing you have the column name wrong in one of the StartsWith() functions.  If that is the case, let SmartSense help by suggesting the column name you want to use in the filter.

The problem is the field Date. Really it is in format date time.

 

 

gennarodp
Post Patron
Post Patron

Thank you very much @Drrickryp.

 

Happy new year

Drrickryp
Super User II
Super User II

Stay safe and be well!

Thank you. Have you news for NFC compatibility for powerapps ? 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (9,823)