cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MaryT0905
Advocate I
Advocate I

How to Filter a Table

I want to filter the items shown in this list to match the customer number selected.  How do I filter this option?

 

fitlerlist.jpg

14 REPLIES 14
mdevaney
Super User III
Super User III

@MaryT0905 

You can show the Customer Number selected in a table by putting this code in the Text property of the label (assuming it’s a number or text column).

 

Table1.Selected.customerNumber

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Thank you, however, after trying that formula, it is not quite what I expected.  This makes all the customer numbers in that column show that number.  The list I am trying to filter is a list of invoices that are associated to various customers.  I want it to show only the invoices that match to the corresponding customer number. Any ideas on this?

This is my current formula and error message. filter error.jpg

@MaryT0905 Could you try with: 

Filter(
   DataTable1,
   customerName_Column1 = CustomerName.Text
)
mdevaney
Super User III
Super User III

@MaryT0905 

If your customerNumber is a Number value do this

Filter(
   your_datasource_name,
   customerNumber = Value(customerNumber.Text)
)

 

If your customerNumber is a Text value do this

Filter(
   your_datasource_name,
   customerNumber = customerNumber.Text
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

I've tried both of these options, and I keep getting "Invalid Argument type"

 

 

I tried this exact formula, and get invalid  argument type.  Let me talk through this a bit.

 

the data source is the data table, then the first part of the formula is the column I want to filer, there is a space on both sides of the equal sign, and then I put customer name. text, because I want it to pull the value for each name. Is that right?

 

Does it matter that the name comes from the Parent. Default? 

 

MaryT0905_0-1599656361853.png

 

@MaryT0905 Your formula is correct now. It doesn't matter if you put spaces around the equal sign.

 

The problem is that your formula is in the wrong location. I've just noticed from your 1st post that its in a text property. You need to put the formula in the Items property of your table!

mdevaney
Super User III
Super User III

@MaryT0905 

Make sure my code is used in the Text property of the label, not the data table itself.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (12,245)