cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Filter a DataTable by information entered into a textbox

Here is my user interface: 

2018-10-15 14_01_51-Microsoft Edge.pngI would like the user to be able to start typing a barcode in the text field on the left, and have the databtale filter and return only results which have a barcode matching the text entered into that field. 

 

E.g. the user starts typing 930

 

and the results in the DataTable change to only list records with a barcode starting with 930. 

 

I have done some reading, but it's not clear to me how to do this, as most filtering examples deal with a gallery. I should point out that the data for the DataTable is collected in a previous screen, and displayed there, as well as this screen. I am happy to do a refresh or a re-collect in this screen if required? Just not sure how to get it working. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper II
Helper II

Re: Filter a DataTable by information entered into a textbox

Never mind, I figured it out 🙂 For anyone else interested in filtering a Data Table by text entered into a text box!

 

If(
    IsEmpty(TextInputFilterBarcode),
    selectedStoreOutOfStockCollection,
    Filter(
        selectedStoreOutOfStockCollection,
        StartsWith(
            Text(Barcode),
            TextInputFilterBarcode.Text
        )
    )
)

View solution in original post

3 REPLIES 3
Highlighted
Helper II
Helper II

Re: Filter a DataTable by information entered into a textbox

I got this to work with the following (yay!)

 

Filter(selectedStoreOutOfStockCollection,StartsWith(Text(Barcode),TextInputFilterBarcode.Text))

However, I need to ensure that if nothing is entered into the text box, there is no filtering applied. I imagine this would be an IF statement of some kind, but not really sure. 

Highlighted
Helper II
Helper II

Re: Filter a DataTable by information entered into a textbox

Never mind, I figured it out 🙂 For anyone else interested in filtering a Data Table by text entered into a text box!

 

If(
    IsEmpty(TextInputFilterBarcode),
    selectedStoreOutOfStockCollection,
    Filter(
        selectedStoreOutOfStockCollection,
        StartsWith(
            Text(Barcode),
            TextInputFilterBarcode.Text
        )
    )
)

View solution in original post

Highlighted
Helper IV
Helper IV

Re: Filter a DataTable by information entered into a textbox

@jamesmatson  hi., where should write this? in textinput field?

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,038)