Caspio allows for keyword searching across multiple fields for quick and effective data finding. In this article, we will present this functionality on a CRM application. It will include a simple search form with one text field where the user can enter a record id, a person’s name, a person’s email address, or a company name and use the same value to search across the ID, Name, Email and Company fields.
To do a keyword search across multiple fields, you will need to separate the report into two DataPages; a form and a report, and pass values from the first to the second using virtual fields.
- In your Submission Form, insert one virtual field for your keyword search and pass it as a parameter to the next DataPage. In our example, the parameter will be [@str].
- In your Report DataPage, use the predefined criteria option instead of a search form and select ID, Name, Email and Company as your criteria fields.
- Configure your Report DataPage to use the field passed from the previous DataPage as a search parameter in all the relevant fields. In our example, in the filtering fields configuration, you should select the comparison type as “Contains” for each field and enable receiving parameter as [@str] so all of them receive the same value.
- Set the logical operator between the keyword search fields to “OR” in the Logic tab.
If you need more search fields in your search form, you can insert more virtual fields. The virtual fields should pass their values as parameters to the report page. If the search fields should narrow down the results, choose AND operator between them in the Logic tab.