You can deploy a search page and a results page into two different web pages. This can be useful if you want to provide a search interface in your navigation bar or if you want to deploy the search widget to multiple websites. This article provides instructions on how to separate a Search and Report DataPage into two DataPages to create separate search and results pages.
- Before you begin to create the DataPages, create the webpage that will host the results page. This way, the URL is ready to be referenced when you create the search page. The search page can be deployed on as many web pages as needed.
Steps for separating a search page and a results page:
1. Create the search page (Submission Form)
In this section, you first create a search page by using a Submission Form.
- On the DataPages’ listing screen, click New DataPage to open a DataPage wizard.
- Although this DataPage will serve as a search page, select Submission Form as the DataPage type. You are going to collect the search criteria using this DataPage and then pass it directly to the results page (a Gallery Report DataPage) which will do the actual work.
- On the DataPage DataSource screen, select the table you’d like to search as your data source.
2. Prepare the Virtual fields
On the Configure Fields screen, create Virtual fields to collect the search data from the end-user. Virtual fields are used because we don’t want to run the search in this form. We also don’t want to create a new record using this form. In fact, this form is only for collecting data and passing it on.
Add as many Virtual fields as you need to run your search. If you are using criteria in your search, you will need to include a separate Virtual field for each, for example, one field for minimum price, another field for maximum price. Now you can select the non-Virtual field that was included in step one and click the delete button.
Configure each Virtual field:
- Modify the field label to reflect the data you’d like to collect.
- Click on the Advanced tab.
- Click the On exit, Pass field value as parameter checkbox.
- Rename the field parameter to match the data that’s being collected. Be sure to use the parameter format: [@xxxxx]
- Note the parameter name to receive the data in the results page.
- Repeat for all the Virtual Fields.
3. Set the destination to the results page
In the Destinations and Emails screen click on Go to a new page. Enter the URL from the results webpage. Be sure to include the protocol (http:// or https://). Now, no matter where the search page is deployed it will direct end-users back to this URL. Click Finish to save your DataPage.
4. Create the results page
- From the DataPages’ listing, click New DataPage. This time, create a Gallery Report DataPage to receive the parameters from the search page, perform the search, and display the results to the end user.
- By default, the cursor selects Submission Form as the first DataPage type. Select Reports on the left menu and click Gallery.
- On the DataPage DataSource screen, select the table you are searching as the data source.
- On the Search Type screen, check Filter data based on your pre-defined criteria and check Allow parameters in search criteria. Click Bridge and external parameters.
- On the Select Filtering Fields screen, move all of the search fields to the right-hand panel using the arrow button.
5. Receive the parameters
Next, you configure the search fields to receive the parameters on the Configure Filtering Fields screen. Configure each DataPage element to receive the corresponding parameter data from the original search page.
- For each DataPage element, click the Advanced tab.
- Select External Parameter from the On load option and enter the parameter name exactly as it was entered in the search page.
- Be sure to use the parameter format: [@xxxxx].
- From the radio buttons available, check If empty, ignore criteria. This way if an end-user leaves one or several options blank, they will still be able to see results.
- Repeat this for all search criteria.
6. Complete the results page and details page as normal.
7. Deploy the DataPages
Next, you can deploy both DataPages. Now that the DataPages have been configured you can deploy them to your web pages. Click Deploy, choose the Deployment Method and Security Settings for the DataPages. Copy the snippet created, and paste it directly into your web page’s HTML. Click Close on the deploy screen.
Testing and formatting
Once the DataPages have been deployed it is a good idea to perform searches using every available field to be sure the results are as expected. If you are having trouble with any particular field be sure that the parameter names in both the search page and the results page are exactly the same.
Once you are happy with the functionality of the separate search and results pages you can take a few minutes to improve the look and feel of the DataPages.