|
Testing a Capture OnTheGo TemplateA Capture OnTheGo (COTG) template will be used to create a form, that can be downloaded, filled out and submitted using the COTG app. Before starting to actually use the template, you will want to make sure that it produces a form that looks good and functions as expected. This topic explains how to preview the form, and how to submit data and preview the submitted data. Previewing the formOn a PCA Capture OnTheGo template can be previewed on a PC in two different ways. Note that Capture OnTheGo form elements will not be functional unless they are sent to a device.
Previewing a COTG Template in the appA COTG Template cannot only be previewed on a PC; it can also be previewed on a mobile device. This will show the template within the Capture OnTheGo mobile application, and all widgets will be functional. In order to test or use any Capture OnTheGo features you need to have a Repository account (also called a COTG Server account or the Store ID). You can get a trial account for this purpose; please see this page for more details: http://www.captureonthego.com/en/promotion/. Once you have your Store ID and Password, you also need to create a user account:
Next, make sure that the Capture OnTheGo mobile application is installed and that it is logged on as a known user of the Capture OnTheGo Repository. Now, with your Capture OnTheGo template open in the Connect Designer module, click on the Send COTG Test… button in the toolbar. Enter the appropriate information in the Send Test dialog (see Send COTG Test). Click Finish to send the document. It should automatically appear in the app's Repository and remain accessible for 2 days from the moment it is sent. Submitting and previewing dataWhen you hit the Submit button in a template in the Designer (on the Live tab), the submitted data can be sent back to the Designer in the form of an XML file (see below). The advantage of this is that you can immediately start creating a Data Mapping Configuration and use the data in a template. Data submitted from the Capture OnTheGo app can be sent to you in the form of an email or saved via a Workflow configuration. Both options are explained below. The Form's validation should ensure that the submitted data is valid. Set the Form's validation method to jQuery and set the requirements and a message per field (see Changing a Form's validation method and How to make COTG elements required).
Get Job Data File on SubmitIt is possible to test a COTG Form in the Designer and get access to an XML file that contains the submitted data, without having a Workflow configuration to handle the data. This option requires that:
If these conditions are met, you can get the XML file as follows:
Checkboxes and Radio buttons that are unchecked will not be submitted to the job data. This is standard behavior in HTML. One can work around that by adding a hidden field before the respective checkbox with the same name and for example value 0 (see Using COTG Elements).
Standard Form input dummy data values
Capture On The Go input dummy data values
* Note that the formatted date and time can be different from the values that the COTG app provides. In the COTG app the formatted date comes from the COTG API, and the formatted date and time normally depend on the locale/region settings on the mobile device. The ISO date and time should be the same as when using the COTG app. Get submitted data via emailGetting submitted data via email requires the Form's action to be set to a test URL that contains an API Key. You can obtain an API Key as follows.
Now, when creating or editing a COTG Form, you can use the API Key in the Form's action:
When you submit the form in the COTG app (see Previewing a COTG Template in the app), the debug service will compose an HTML email that contains the form element names and the submitted values. Image files, like pictures and signatures, are added to the email as attachments. The email will be sent to the email address that you provided via your Learn profile. For a more detailed description of this test procedure, see this how-to: Testing a COTG template. Get submitted data via WorkflowEventually, when a user submits a Capture OnTheGo Form, the data are received by the Workflow HTTP Server Input task (see Workflow Help: HTTP Server Input) that has the same HTTP action as the one specified in the Form's action (see COTG Forms). The Workflow configuration should then handle the submitted data. But even if it doesn't, when no other tasks are present in that Workflow configuration, Workflow can output an XML file that contains the submitted data and save it in a location specified for the Send To Folder plugin in Workflow. |
|