Hi guys,
I'm having issues with filtering on several textboxes and controls. To save a bit of time I won't go into the ins and outs of why i'm trying to do what I'm doing, but I'll tell you the controls I have and what is happening and what should be happening.
I have a toggle control which toggles between contracted and non-contracted. If it's enabled it's contracted, if it's disabled it shows non-contracted suppliers. This is the master control, and regardless of what other filters are selected or typed this filter should always be active.
I have a textbox known as textbox1. This is a keyword search and I want this to be searchable across multiple fields. At the moment I have this set up to search within city. So when I click to enable the toggle to show contracted, and I type the city of leeds it will show all contracted suppliers within leeds. If I then click the toggle again, it will show all non-contracted suppliers in leeds. Same as if I erase the city it should then show me all contracted or non-contracted suppliers depending on what the toggle is selected as.
Thirdly, if there is nothing typed in the keyword search and I type something in my third control, I then want it to filter just on that control. The third control is the city field at the moment, but I will be reproducing this for all the other fields , so that the user can either have the choice of searching within the keyword search or they can select individual filters.
This is my code so far...
Sort(If(IsBlank(TextInput1.Text),
Filter('Supplier Database Table',TextBox1.Text = Text(Contracted_x003f_)),
Filter( 'Supplier Database Table',
TextInput1.Text = Text(Lower(City))
&& TextBox1.Text = Text(Contracted_x003f_) )),
Supplier_x0020_Name, If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))
Whenever I try to nest this it ignores the contracted toggle.