cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
infinitepp
Helper I
Helper I

Radio button and Search Text in Gallery.

Hi,

I want to use the Radio button to Filter the data in the table: "myTable" column "Type" and want to Search Code or Fname or CizID in txtSearch.Text

I try to use the code below but It's not working. Please help.

Thank you for any suggestion.

 

Filter(myTable,txtSearch.Text in Code,
            txtSearch.Text in FName,
            txtSearch.Text in CizID),
If(
    Radio1.Selected.Value = "Housing",
    Filter(
        myTable,
        Type = Radio1.Selected.Value
    ),
    Radio1.Selected.Value = "Direct Sales",
    Filter(
        myTable,
        Type = Radio1.Selected.Value
    ),
    Radio1.Selected.Value = "Tele Sales",
    Filter(
        myTable,
        Type = Radio1.Selected.Value
    )        
)
      

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @infinitepp ,

You seem to have two tables in there (myTable and tbl_mas_saleagents). Assuming they are the same table, you could do something like this

With(
   {
      wText:txtSearch.Text,
	  wRadio: Radio1.Selected.Value
   },      
   Filter(
      myTable,
      (wText in Code || wText in FName || wText in CizID) &&  
      If(
         wRadio = "Housing" || wRadio = "Direct Sales" || wRadio = "Tele Sales",
         SubChannelCode = wRadio
      )
   )	  
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @infinitepp ,

You seem to have two tables in there (myTable and tbl_mas_saleagents). Assuming they are the same table, you could do something like this

With(
   {
      wText:txtSearch.Text,
	  wRadio: Radio1.Selected.Value
   },      
   Filter(
      myTable,
      (wText in Code || wText in FName || wText in CizID) &&  
      If(
         wRadio = "Housing" || wRadio = "Direct Sales" || wRadio = "Tele Sales",
         SubChannelCode = wRadio
      )
   )	  
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

v-jefferni
Community Support
Community Support

Hi @infinitepp ,

 

Could you please share more details about your data source? What is your data source table? Which type is the SubChannelCode column?

 

Assuming SubChannelCode is a Text type column, then please try:

Filter(
       Filter(
        tbl_mas_saleagents,
        SubChannelCode = Radio1.Selected.Value
       )  
       txtSearch.Text in Code,
       txtSearch.Text in FName,
       txtSearch.Text in CizID
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Sorry for my mistake. I forget to change the table name and column. 

 

I forget to change the table name and column. Sorry for my mistake 😣

I tried to use your code but Searching in the textbox is not working.

Thank you so much for your solution. 

It's work right now!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,479)