cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shaneOZ
Responsive Resident
Responsive Resident

Text search box doesnt work on filter if dropbox is on a particular value

Hi,

 

I have an app with the following code, however if the dropdown is on "ALL" the text searchbox doesn't filter the gallery. Yet it works if the dropdown is on the other options?

 

Could someone help me modify the following code, i cant work it out

 

 

SortByColumns(
              If(StatusDropdown.Selected.Value = "ALL", 
                 'JSA',
                 
                 Filter(
                        'JSA',
                        Status = StatusDropdown.Selected.Value,
                        StartsWith(
                                   JSAID,
                                   TextSearchBox1_1.Text
                                   )
                         )
                   ),
               "Created",
    If(
        SortDescending1,
        Descending,
        Ascending
    )
)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @shaneOZ ,

 

That is because you didn't apply the filter function to table when dropdown is 'All'. Please modify the code as follows:

SortByColumns(
              If(StatusDropdown.Selected.Value = "ALL", 
                 Filter(
                        'JSA',
                        StartsWith(
                                   JSAID,
                                   TextSearchBox1_1.Text
                                   )
                         ),
                 Filter(
                        'JSA',
                        Status = StatusDropdown.Selected.Value,
                        StartsWith(
                                   JSAID,
                                   TextSearchBox1_1.Text
                                   )
                         )
                   ),
               "Created",
    If(
        SortDescending1,
        Descending,
        Ascending
    )
)

Hope this helps.

Sik

View solution in original post

2 REPLIES 2
eka24
Super User III
Super User III

Try

SortByColumns(
If(StatusDropdown.Selected.Value <>"ALL",
Filter( JSA,Status = StatusDropdown.Selected.Value && StartsWith( JSAID, TextSearchBox1_1.Text )),
Filter( JSA, StartsWith( JSAID, TextSearchBox1_1.Text ))),
"Created", If( SortDescending1, Descending, Ascending ) )

------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

v-siky-msft
Community Support
Community Support

Hi @shaneOZ ,

 

That is because you didn't apply the filter function to table when dropdown is 'All'. Please modify the code as follows:

SortByColumns(
              If(StatusDropdown.Selected.Value = "ALL", 
                 Filter(
                        'JSA',
                        StartsWith(
                                   JSAID,
                                   TextSearchBox1_1.Text
                                   )
                         ),
                 Filter(
                        'JSA',
                        Status = StatusDropdown.Selected.Value,
                        StartsWith(
                                   JSAID,
                                   TextSearchBox1_1.Text
                                   )
                         )
                   ),
               "Created",
    If(
        SortDescending1,
        Descending,
        Ascending
    )
)

Hope this helps.

Sik

View solution in original post

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

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (29,128)