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

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.

 

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.

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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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