I have a form with a table populated from a Lookup rule and a single field to filter the Lookup.
Here's the Lookup:
Here's the store procedure I am using for the Lookup:
@EmployeeName VARCHAR(100) = '' SELECT *, (SELECT CASE WHEN mda.application_status = 'Active' THEN 1 WHEN mda.application_status LIKE 'Pending%' THEN 2 WHEN mda.application_status = 'Inactive' THEN 3 WHEN mda.application_status = 'Declined' THEN 4 WHEN mda.application_status = 'Canceled' THEN 5 ELSE 3 END) AS statusOrder FROM uhf_mobile_device_application mda WHERE (@EmployeeName = '' OR employee_name = @EmployeeName) ORDER BY employee_name, statusOrder, service_start
As you can see in the SPROC if there is no value passed for the parameter @EmployeeName it will default to empty set and in the Where clause if @EmployeeName is empty then it should return all rows. However, you can see in my screenshot the table is not populating when the the Employee Name field is empty. I tested the SPROC in SSMS with nothing in the parameter and it does return all rows. My question is what does Laserfiche Forms send as a parameter if the Employee Name field is blank? If I put a default value in the Employee Name field like my name then the Lookup populates the table with all rows with my Employee Name but I want the table to populate with all rows to start then only filter for Employee Name once a name is typed into the Employee Name field.