...
Description | Function | Returns |
---|---|---|
This global function triggers the process of retrieving all public Data Suitcases for an answerSpace. | processMoJOs () | @returns {jQueryPromise} |
To store a data suitcase with Javascript you can use | MyAnswers.store.set( 'mojoXML:my_mojo_name' , data); | @returns {jQueryPromise} |
Data Suitcases Populating A BlinkForm
As most uses of this involve XPath queries under your control, the precise tag used for the root element is not important, although valid XML specifies exactly 1 root element. This format is used for network transmission, and data suitcase (MoJO) storage.
Glossary #
- field type: BlinkForms2 types are not the same as the HTML Input Type.
- field name: unique identifier (within the form) for the field, matches a DB column, restricted characters (\w+)
- field label: not necessarily the same as the name, fewer restrictions on characters
- form object name: unique identifier (within an answerSpace) for the form, matches a DB table, restricted characters (\w+).
- tuple: Database-speak for a particular row / record in a DB table
Example 1
Here are 2 tuples (records) for the formObject1Name form.
Note that the 2nd tuple omits several fields, simulating non-mandatory fields or an incomplete state.
Values that contain multiple values, such as “multi” select fields and “checkboxes” fields, should list the values in EOL-delimited plain-text.
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<root>
<formObject1Name>
<fieldName1>value</fieldName1>
<fieldName2>value</fieldName2>
<fieldName3>value</fieldName3>
<fieldName4>
<!-- sub_form type -->
<formObject2Name>
<fieldName1>value</fieldName1>
<fieldName2>value</fieldName2>
</formObject2Name>
<formObject2Name>
<fieldName1>value</fieldName1>
<fieldName2>value</fieldName2>
</formObject2Name>
</fieldName4>
<fieldName5>
<!-- multi(-select) or checkboxes type -->
valueA
valueB
</fieldName5>
</formObject1Name>
<formObject1Name>
<fieldName3>value</fieldName3>
<fieldName4>
<!-- sub_form type -->
<formObject2Name>
<fieldName2>value</fieldName2>
</formObject2Name>
</fieldName4>
</formObject1Name>
</root> |
Example 2
Here are some examples including correct field formats.
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<yourtext>
Sample TextBlink Forms is now saving your Blink Form Object and generating
Blink Forms Definitions which should allow you to view
and use the form once this process has completed successfully.</yourtextarea>
<yourselectbox>2</yourselectbox>
<yourdate>2012-07-27T00:00:00+10:00</yourdate>
<yourtime>12:38:55+10:00</yourtime>
<yourdatetime>2012-10-30T00:09:30+10:00</yourdatetime>
<yourradio>Option A</yourradio>
<yourlocation>{"altitude":null,"latitude":-33.868901,"altitudeAccuracy"
:null,"heading":null,"accuracy":25000,"longitude":151.207091,"speed":null}</yourlocation>
<yourmulti>Option A
Option D</yourmulti>
<yourimage>data:image/png;base64,YourBase 64 encoded string</yourimage>
<yoursignature>data:image/png;base64,Your Base 64 encoded string
</yoursignature> |
You can download the sample XML code and an answerspace example in the attachments section below.
JSON
This format is used for local storage in the submission queue, and loosely describes the non-JSON data structure used in the HTTP POST transaction for form submissions.
Note that this has been formatted with additional non-compliant white-space for educational purposes. We recommend working with JSON as it is generated by software, which will not contain this additional white-space.
Example 3
Here is 1 tuples (records) for the formObject1Name form.
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
{
“fieldName1”: “value”,
“fieldName2”: “value”,
“fieldName3”: “value”,
“fieldName4”:
[
{ // field values for a new subForm tuple
“fieldName1”: “value”
“fieldName2”: “value”
},
{
“fieldName1”: “value”
“fieldName2”: “value”
},
“subTuple3” // primary key for existing subForm tuple
],
“fieldName5”:
[ // multi(-select) or checkboxes type
“value”,
“value”,
“value”
]
} |