Hello,
I am trying to filter a Data Table utilizing 4 Text Input Boxes and 1 Date Packer Input Box. I am able to successfully filter utilizing the 4 Text Input Boxes (code A noted below). The code below is built specifically this way to allow users to filter on any combination of Text Input Boxes that they wish (that is why I have the or setup for if the Text Input Box is left blank by the user).
A
Filter(PO_Requests,And(PO_Num=PO_Num_Input.Text||PO_Num_Input.Text="",Requestor=Requestor_Input.Text||Requestor_Input.Text="",Request_Type=Request_Type_Input.Text||Request_Type_Input.Text="",Request_Result=Request_Result_Input.Text||Request_Result_Input.Text=""))
I cannot get the Date Input Picker box to successfully work in the code below. I tried the two code versions below (B & C) and neither work.
B
Filter(PO_Requests,And(PO_Num=PO_Num_Input.Text||PO_Num_Input.Text="",Requestor=Requestor_Input.Text||Requestor_Input.Text="",Request_Type=Request_Type_Input.Text||Request_Type_Input.Text="",Request_Result=Request_Result_Input.Text||Request_Result_Input.Text="",Created=Created_Input.SelectedDate||Created_Input.SelectedDate=""))
This one causes an error. I believe it is because I am using "" on the last part of the date filter string and date is a number, not text. I am not sure how to say that the Created_Input.Selected date is left blank (in number format).
C
Filter(PO_Requests,And(PO_Num=PO_Num_Input.Text||PO_Num_Input.Text="",Requestor=Requestor_Input.Text||Requestor_Input.Text="",Request_Type=Request_Type_Input.Text||Request_Type_Input.Text="",Request_Result=Request_Result_Input.Text||Request_Result_Input.Text="",Created=Created_Input.SelectedDate||Created_Input.SelectedDate=0))
In this one, I did not use the "" on the last part of the date filter and instead used a 0. This does not cause an error, but it does not filter my data correctly. I think this is because the DefaultDate setting on my Date Picker Input Box is not zero (it is ""). I tried setting my DefaultDate to zero, but it defaults to a 1970's date. I then tried setting the DefaultDate to Today() and then updated my code above to be equal to Today(), but that didn't work either.
Any help would be appreciated. Thank you in advance for any assistance provided.
-Chris