Passing Parameters through Caspio
3 minutes to readYou can use parameters to pass data from one DataPage to another. There are two methods to accomplish this transfer. You can either pass parameters using the internal Caspio session, or use a query string.
This article shows how you can pass parameters internally through Caspio. This method has the advantage that the parameter data is not visible in the address bar of your end user’s browser. To learn about how your DataPages can receive parameters, refer to the Receiving Parameters article.
Passing a Parameter
- Navigate to the DataPage wizard, select a DataPage you want to modify, and proceed to Configure Fields screen. Submission Forms have one Configure Fields screen, but Report DataPages have three (search, results and details pages). In the Advanced tab, the section that pertains to parameters is External Associations and Defaults. Passing parameters from Results Page can be achieved using a query string.
- To pass a parameter to the next page, enable the On exit option by checking Pass field value as parameter and enter the parameter value. If a parameter is entered in this field, the DataPage will place the field’s value in the current Caspio session for future DataPages to use. The wizard will generate a default parameter name that matches the field name. You can change this name if you need to, but it must maintain the correct syntax: [@xxxxx]. Your data will be accessible under this parameter name until it is replaced, or the session expires. Save this parameter name for later reference when you want to receive this parameter.
- Click Finish.
Note: In the details page of Report DataPage, you can only pass parameters from fields that are editable or hidden and not display only.
Passing ID and Formula field
In Web Forms, all auto-generated values, that is: Autonumber, Random ID, Prefixed Autonumber, GUID and Formula fields must be passed in a special way. In the Select Fields screen of the DataPage wizard, check On exit, pass ID and formula field as parameters under the left panel to enable passing these values as parameters.
Auto-generated values 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 as shown above.
The parameter name will need to be formatted in a special way as shown in the example below:
Example: [@InsertRecordApplication_ID]
Direct Your End User to the Next DataPage
On Destination and Emails screen, you can direct the end-user to the DataPage, or host web page, that will receive your parameters.
Remember that passing a parameter makes the data available for all future DataPages until the data is overwritten or the session expires. The receiving DataPages must have parameters enabled and must be correctly configured to receive the parameters.