This article explains the different ways that parameters can be received in DataPages. You can receive parameter data and input it directly in your DataPage fields. You can also receive parameters to display the data in formatting blocks such as headers and footers, and HTML blocks. When receiving parameters from outside of Caspio, it is the easiest to use query strings.
Receiving parameters as field data
To receive parameters as field data, proceed to the Configure Fields screen. Web Forms have one Configure Fields screen and Search and Report DataPages have three configuring field screens. Select the field under the DataPage Element panel that will catch the parameter and click the Advanced tab. The section that pertains to parameters is External Associations and Defaults. To receive a parameter in a field, enable On load option by checking the Receive value or parameter. Select a default value or parameter from this dropdown and enter a parameter name to receive parameters.
Ensure that the parameter name in the receiving DataPage matches exactly to the parameter name created in the passing DataPage. If you are using a query string, then the field name must match exactly with the fieldname used in the URL. Parameters should always have the syntax [@xxxxx].
Receiving a parameter in a formatting block
In HTML blocks, headers, or footers, you can receive a parameter by copying the parameter name from the passing DataPage and pasting or entering it directly into the formatting block. Be sure that the parameter uses the correct syntax [@xxxxx], and that the fieldnames match exactly.
Receiving an AutoNumber parameter
AutoNumbers passed from a Web Form have a slightly different syntax than other parameters. You must add “InsertRecord” as a prefix before the fieldname to receive this unique field type. The syntax of this type of parameter is [@InsertRecordApplication_ID]
Using parameters as pre-defined search criteria
Pre-defined search criteria are used to bypass the search page. You can receive parameters as pre-defined criteria and go directly to a list of results, or directly a specific details page.
- First, create a Search and Report DataPage in the DataPage wizard.
- In the Search Type screen, check Filter data based on your pre-defined criteria.
- In the Select Filtering Fields screen, you will select your pre-defined criteria fields by moving them to the panel on the right.
- On the Configure Fields screen, you will configure your predefined criteria to receive a parameter value in the Advanced tab. Select the Receive value or parameter checkbox, select an option from the dropdown and enter the parameter in the space provided.
You can also define filtering behavior with empty or missing parameters:
- Value required – If the parameter is missing or empty, the search does not return any records.
- If empty, match blank values only – This search returns records with blank values if this field is left blank.
- If empty, ignore criteria – The search ignores the criteria if this field is left blank.
- If empty, match all records – The search returns all records from the table, no matter what their values are.
Proceed with the remaining steps as normal. Click Finish.
Testing DataPages that receive parameters
When previewing a DataPage that receives a parameter, you will first see the Parameter Simulation window. This window allows you to perform basic testing of receiving DataPages before you even create the DataPage (or outside element) that will be passing the parameters.