frevvo v10.2 is no longer supported. Please visit frevvoLatest for our current Cloud Release. Earlier documentation is available too.
Data Sources
For practical examples of this approach please refer to Creating a Form Connected to your Database.
In general,
By dragging Palette Controls onto the form canvas
By adding controls from a data source
It's very common and easy to create your form by dragging and dropping controls from
You can mix and match these two approaches of form creation. You can create all the controls in your form from XML schema elements. You can create all the controls in your form from the
Basic Concepts
When users submit a form that was created wholly or in part from schemas, you will see in the Submissions repository one XML instance document for each global schema element. You also will see one XML document for the form itself, which references any controls you dragged in from the palette. All XML documents are automatically validated against their schemas.
When you upload a schema to
At a high level, when you work with schemas you do the following:
Upload your schema to one of your
projects
Choose the global elements you want and add them to your form’s Data Sources
Generate form controls from the global elements you added
Modify the controls (if necessary) to suit your form
These steps are discussed in detail below.
Form Schema
automatically generates an XSD schema representation of your form as you drop controls from the palette to the form designer canvas. You can download this XSD by selecting Download Schema from the Action Menu on the Forms and Workflow Homepage. The XSD elements are named after the control names. The types are based on which control you selected from the palette. For example a Quantity control will appear as an xsd:integer. A dropdown will be an xsd:simpleType restriction. Controls with patterns such as the Zip will have an auto-generated type with your pattern. Click "expand Source" for an example.
Generating an XML Schema
First, you need to generate an xml schema that will be uploaded to . See the chapter Creating a Form Connected to your Database for instructions on generating a schema using the Database Connector.
Using Your Schema
Before you can use global elements from a schema in a form, you must upload the schema XSD file into one of your projects. To upload a schema:
From the Projects page, click the name of the project with the forms that will use the schema.
Click Schemas from the left-hand menu.
From the Schemas page, click the
Add icon.
On the Upload Schema Page, type a meaningful name for your schema and provide a description. (These are optional but highly recommended.) The Name and Description are each limited to 255 characters.
Click Browse, locate the schema XSD file or zipfile with multiple related XSDs on disk.
If there are multiple global elements in the zipfile(s) specify exact name (relative to the top level directory separated by the '/' character of the XSD file containing the root schema.
Click Upload.
If your schema is valid, its name now will appear on the Schemas page. You can sort the Schemas list alpahbetically (A-Z or Z-A). If you tried to upload an invalid schema, will not allow the upload and display an error message.
Important notes about uploading schemas:
You may add as many schemas as you require; however, you cannot have two or more data sources in your project with the same root element name.
You may use global elements from uploaded schemas in any and all forms in the project.
If you want to use the same schema elements in multiple projects, upload the schema to each project separately.
If your schema references another schema, you must upload all related schemas in a single zipfile.
If you upload a zipfile all the schemas in the zipfile must be related.
If you have unrelated schemas you must upload them individually or alone in their own zipfile.
If you add a data source (XSD) to your form/workflow that has the root element name "form" that uses by default for the palette control XSD, you will see an application error. To resolve, edit the form or workflow "Element Name" property and change it from the default "form" to whatever you want to call it.
Adding Elements to a Form’s Data Sources
Once you’ve uploaded your schema, the next step is to choose the global elements you want for a particular form. The elements you choose will be displayed in the form’s Data Sources area on the lower left portion of the Forms Designer. You may add the elements to as many forms as you wish, but you must work with one form at a time.
To add the elements to a form’s Data Sources:
Open the form in the Forms Designer (by clicking the form name from the Form and Workflows Homepage).
In the Data Sources area on the left side of the Forms Designer, click New from XSD
icon.
You’ll see all available schemas; click the plus sign
to expand the schema folders and display the global elements from each.
Click the
icon next to each global element you want. If the element is a complex type, you will see the parent element only, but the child elements will be added automatically to your form’s Data Sources. You may add as many elements as you like.
After you close the page, you’ll see in the Data Sources area each element you chose. (We added the Address Book and Policy Information global elements in this example.) For each element you added to your form’s Data Sources, will generate an XML instance document that you will see in the Submissions repository each time users submit your form, even if you do not end up generating a control from the element. Therefore, if you add an element to your form but later determine you don’t need to generate a control from it, make sure to delete the element from the form’s Data Sources.
Adding multiple data sources from the same namespace will cause a clash in your form. And in fact will assist you by preventing you from making this mistake. A warning message is displayed in the Add Data Source panel when you click plus.
Similarly, multiple XSD files composing a single logical namespace is not supported. Instead, merge all XSD files for the same namespace into a single XSD file and then upload into .
Generating Controls from Schema Elements
Once the global elements are part of your form’s Data Sources you can generate controls for any or all of them.
To generate a group control that automatically includes controls for all of a parent element’s children, click the icon to the right of the parent. The controls for the children elements will be inside a section control. If the complex type has repeating items, the section will be inside a repeat control.