cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jamesmatson
Level: Powered On

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
jamesmatson
Level: Powered On

Re: Filter a DataTable by information entered into a textbox

Never mind, I figured it out Smiley Happy 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
        )
    )
)
3 REPLIES 3
jamesmatson
Level: Powered On

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
jamesmatson
Level: Powered On

Re: Filter a DataTable by information entered into a textbox

Never mind, I figured it out Smiley Happy 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
        )
    )
)
neethup
Level: Powered On

Re: Filter a DataTable by information entered into a textbox

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

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 144 members 3,694 guests
Please welcome our newest community members: