ft_api_show_submission
API
Requirements
- It requires the Export Manager module to be installed and enabled.
- To generate the HTML, it uses one of the export types - so you may find you need to create a new one with the appropriate formatting (discussed below).
The general requirements for the Form Tools API also apply.
Overview
This function displays an individual submission. This can actually already be achieved with ft_api_show_submissions, but this function is written for this precise purpose, so you may find it simpler to use.
The function takes the following required parameters:
<?php
ft_api_show_submission($form_id, $view_id, $export_type_id, $submission_id);
?>
Here's a simple example. In it, the Form ID is 10, the View ID is 15, the Export Type ID is 6 and the Submission ID is 155.
<?php
// remember to update this path
require("/path/to/global/code/api/api.php");
ft_api_show_submission(10, 15, 6, 155);
?>
All of this information is required to let the function know how to find and display the submission information. The View controls what fields will be displayed; the export type ID determines the visual rendering of the field information.
How to find the form, View, export type and submission IDs
- The form ID can be found in Form Tools. Log in as the administrator and go to the Form List page. The "ID" column is the form ID.
- The View ID is found on the Views tab of the form. That tab lists all available Views, and like the forms contains an ID column for the View ID.
- To find the export type ID, go to the Modules page and select the Export Manager module. Click the Export Group you want to use to determine the results (probably the HTML / Printer-friendly or another custom group), then click on the "Export Types" tab. That lists the IDs of all export types that belong to that group.
- To find the submission ID, you'll need to go to the main submission listings page for your form (click "VIEW" on the form list page in Form Tools. However, not all Views may display the submission ID. You will need to pick one that shows this information (and if one doesn't exist, create one). All forms are initially created with an "All Submissions" View, which contains the submission ID as the first field. Try looking there!