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

Filter for Exact matches only when a radio button is selected

I have the following filtering based on 3 fields.

The search is automatically doing what I call a wildcard search.

 

If I select a radio button "Radio1" control...say option 1 , I need the filter to do only a Exact Match Search ? on the term in

FilterTextBox   Box 

 

Current Code:

Filter('[dbo].[v_sst_source_select_search]',
    FilterTextBox.Text in Brand
    Or FilterTextBox.Text in Supplier_Name
  Or FilterTextBox.Text in Supplier_Number
)

 

Thanks

David Powell

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filter for Exact matches only when a radio button is selected

@DAVIDPOWELL 

I have corrected my typo in the original post.  Please go ahead and mark the solution!

 

---
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."

View solution in original post

11 REPLIES 11
Super User
Super User

Re: Filter for Exact matches only when a radio button is selected

@DAVIDPOWELL
You can replace in with exactin to get the desired result.

Filter('[dbo].[v_sst_source_select_search]',
FilterTextBox.Text exactin Brand
Or FilterTextBox.Text exactin Supplier_Name
Or FilterTextBox.Text exactin Supplier_Number
)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
DAVIDPOWELL
Level: Powered On

Re: Filter for Exact matches only when a radio button is selected

what about the addition of the radio button?

Super User
Super User

Re: Filter for Exact matches only when a radio button is selected

@DAVIDPOWELL 

Good point.  I missed that requirement.

 

Filter('[dbo].[v_sst_source_select_search]',
    RadioButton1.Value = "Brand" And FilterTextBox.Text exactin Brand
    RadioButton2.Value = "Supplier_Name" And Or FilterTextBox.Text exactin Supplier_Name
    RadioButton3.Value = "Supplier_Number" And Or FilterTextBox.Text exactin Supplier_Number
)

 

---
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."

DAVIDPOWELL
Level: Powered On

Re: Filter for Exact matches only when a radio button is selected

@mdevaney,

went with a toggle object....so  ?

If(Toggle1.Value = false,
Filter('[dbo].[v_sst_source_select_search]',
    FilterTextBox.Text in Brand
    Or FilterTextBox.Text in Supplier_Name
  Or FilterTextBox.Text in Supplier_Number
)
,Filter('[dbo].[v_sst_source_select_search]',
    FilterTextBox.Text exactin Brand
    Or FilterTextBox.Text exactin Supplier_Name
  Or FilterTextBox.Text exactin Supplier_Number
)
)

Super User
Super User

Re: Filter for Exact matches only when a radio button is selected

@DAVIDPOWELL 

I see what your goal is now.  I misunderstood before...

You have the right idea but we should try to avoid using the IF statement because it will give a delegation warning.  Here's my proposal.

 

Filter('[dbo].[v_sst_source_select_search]',
    (Toggle1.Value = true And FilterTextBox.Text exactin Brand)
    Or (Toggle1.Value = true And Or FilterTextBox.Text exactin Supplier_Name)
    Or (Toggle1.Value = true And Or FilterTextBox.Text exactin Supplier_Number)
    Or (Toggle1.Value = false And FilterTextBox.Text in Brand)
    Or (Toggle1.Value = false And FilterTextBox.Text in Supplier_Name)
    Or (Toggle1.Value = false And FilterTextBox.Text in Supplier_Number)
)

 

 

---
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."

DAVIDPOWELL
Level: Powered On

Re: Filter for Exact matches only when a radio button is selected

THE   And Or part of the code is giving it fits.

 

also...I'm using sql server, so I hope no delegation issues.

 

DAVID

Super User
Super User

Re: Filter for Exact matches only when a radio button is selected

@DAVIDPOWELL 

I don't understand "it gives me fits".  You'll have to show me what you mean.

DAVIDPOWELL
Level: Powered On

Re: Filter for Exact matches only when a radio button is selected

@mdevaney 

 

sorry, its an error message... 

but also, I was reading "exactin" documentation.  that is used for Capitalization searches or non-capital searches.

By Exact I mean,  If i'm looking for  "Columbia Pipe" (regardless of caps or not) it will only find "Columbia Pipe"

other wise if I search for "Columbia" it will also Find "Columbia pipe"

 

Thanks

David

Super User
Super User

Re: Filter for Exact matches only when a radio button is selected

@DAVIDPOWELL 

Wow, I did not know that about exactin.  I guess it makes sense.  If we want the exact value we should just use an equals sign instead of exactin.

 

 

Filter('[dbo].[v_sst_source_select_search]',
    (Toggle1.Value = true And FilterTextBox.Text = Brand)
    Or (Toggle1.Value = true Or FilterTextBox.Text = Supplier_Name)
    Or (Toggle1.Value = true Or FilterTextBox.Text = Supplier_Number)
    Or (Toggle1.Value = false And FilterTextBox.Text in Brand)
    Or (Toggle1.Value = false And FilterTextBox.Text in Supplier_Name)
    Or (Toggle1.Value = false And FilterTextBox.Text in Supplier_Number)
)

 

 

---
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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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