V2.0 Data Sources and Schemas
From Frevvodocs
Data Sources and Schemas
Overview
frevvo allows you to generate forms automatically based on one or more XML schemas, so you quickly can create forms that align with your databases, web services, BPM system, and key business applications. You can create all the controls in your form from XML schema elements, or you can create part of the form from schema elements and drag in from the palette additional controls that have no relation to the elements in your schema.
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 frevvo, you can use any and all global elements in the schema. If you want items from the schema that are not global elements, edit the schema and make the items global elements before uploading the schema to frevvo.
At a high level, when you work with schemas you do the following:
- Upload your schema to one of your frevvo applications
- Choose the global elements you want and add them to your form’s Data Sources
- Generate form controls from the global elements you’ve added
- Modify the controls (if necessary) to suit your form
These steps are discussed in detail below. Note that this functionality is available in the XML Edition only.
Uploading a Schema
Before you can use global elements from a schema in a form, you must upload the schema XSD file into one of your frevvo applications.
To upload a schema:
1. From the Applications page, click the Edit
icon underneath the name of the application with the forms that will use the schema.
2. Click Schemas from the left-hand menu
3. From the Schemas page, click the New
icon
4. On the Upload Schema Page, type a meaningful name for your schema and provide a description. (These are optional but highly recommended.)
5. Click Browse, locate the schema XSD file on disk and click Upload.
If your schema is valid, its name now will appear on the Schemas page. If you tried to upload an invalid schema, frevvo will not allow the upload and display an error message.
Important notes about uploading schemas:
- You may add as many schemas as you require
- You may use global elements from uploaded schemas in any and all forms in the application
- If you want to use the same schema elements in multiple applications, upload the schema to each application separately.
- If your schema references another schema, you must upload the included schema before you upload the parent schema
Adding Schema 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:
1. Open the form in the Forms Designer (by clicking the form name from the Forms Page).
2. In the Data Sources area on the left side of the Forms Designer, click New from XSD
icon.
3. You’ll see all available schemas; click the plus sign
to expand the schema folders and display the global elements from each.
4. 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, frevvo 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.
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. As shown below complex types are represented by a folder icon; simple types by a document icon.
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 complex type’s folder icon. The controls for the children elements will be inside a section control as shown below. If the complex type has repeating items, the section will be inside a repeat control.
To create individual controls for specific children of a complex type, click the
icon to expand the complex type and click the
icon next to each desired child element. For example, in the above example we could generate controls for First Name and Last Name but not for the phone number or email address.
Note that you do not drag the elements into your form; instead when you click the
icon the generated controls are automatically added to the top of your form. You can then place the controls where you want them by following the normal drag and drop rules, with one additional restriction: you cannot drag any control into or out of a repeat control generated from a schema element. (If you need to do this, you will have to edit the schema.) Rearranging the controls will not affect the structure of the form’s XML submission documents or how submission data is captured.
Controls generated from schema elements will appear initially as text controls unless the schema specifies element restrictions. In this case, the control will be a dropdown if there are four or more valid choices and a radio button if there are fewer than four valid values. All validation for the controls will be based on the schema. See below.
Modifying Controls Generated from Schema Elements
There are two ways to modify controls that you generated from schema elements. You can:
- Make changes to the controls in the Forms Designer
- Make changes to the schema, and then update the schema in frevvo by uploading the revised schema
Changes You Can Make in the Forms Designer
For controls generated from schema elements, you can make some but not all of the changes that you can for controls you drag in from the palette. Here are the changes you can make in the Forms Designer:
- Create rules that rely on the controls
- Set default value for the controls
- Rearrange the location of controls in your form. This includes moving sections into tabs or panels. As noted above, in addition to the normal drag and drop restrictions, you may not drag any control into or out of a repeat control generated from a schema element.
- Modify the control’s “Format As” property to change how the control looks on the form. This Format As property appears only for controls created from schema elements and appears instead of the Control Type property that you see for controls you have dragged in from the palette.
- Change the control’s label. You’ll see the new label name in the Submissions Repository Data Tab and in Excel if you download the submission results. However, the Submissions XML document for the schema will reflect the original element name.
Note that you cannot change a control’s validation behavior in the Forms Designer as you can for controls you drag in from the palette. You must do this by changing the schema. This is discussed below.
In general, the Forms Designer prevents you from making changes that will violate the integrity of the schema and cause issues when users submit your form. One exception is if you inadvertently generate two controls from the same element—in this case, users would see two controls on the form and could submit two different values, but the Submissions XML document would not be able to capture both values since the element exists only once in the schema.
You also must be careful when deleting elements from the Data Sources area, especially if you have previously created controls from these elements. This is discussed in detail below.
Changes You Cannot Make in the Forms Designer
One of the most important differences between controls generated from schema elements and controls you drag in from the palette is validation behavior. You’ll notice for example that you can’t check or uncheck the control’s REQUIRED checkbox in the Form Designer Properties area, nor can you access the control’s Pattern property.
Validation for controls you generate from schema elements is based on the element’s XSD type and other schema-specific information, such as whether the control is required based on the minOccurs value. If you generate a control from an element that is an integer and another from an element that is a string, the two controls initially will be generated as text controls but the first control will require users to enter integers and the second control will not.
You can see an element’s XSD type by clicking the control in your form and hovering over the Properties area of the Forms Designer--the XSD type will be displayed as a tooltip. The only way to change the validation for a control generated from a schema element is to revise the schema and update the schema in frevvo with the new version. The same is true for other changes you wish to make that you cannot accomplish in the Forms Designer.
Updating a Schema
If you need to make changes beyond those allowed in the Forms Designer, make the changes in your XSD file and replace the old schema with the new one in frevvo.
To update a schema:
1. Click Schemas from the left-hand menu. (Remember, schemas are application-specific, so if you don’t see your schema, it may be in another application.)
2. You’ll see all a list of all uploaded schemas. Click the icon underneath the name of the schema you are updating.
3. On the Update Schema page, click Browse and locate the new XSD file. You may change the schema name and description but this is optional.
4. Click Update.
When you open (edit) any form that used the schema, the Data Sources area will be refreshed automatically. Do not delete the updated elements from the Data Sources area unless you are absolutely sure no controls in your form were generated from the elements in the previous version of the schema. Also, do not delete the elements and try to re-add them. This will cause any controls that relied on the schema to become unbounded and moved out of the schema XML document into the form's default XML document.
Adjusting Your Form after Updating the Schema
Although frevvo automatically refreshes the elements in the Data Sources area, this does not necessarily mean your form is up to date. You must edit your form, save it, and test it again to make sure the changes to the schema have produced the results you expected.
Depending on how you revised your schema, you may have to adjust the controls in your form. In most cases, you’ll need to delete the control from your form, and then re-generate a replacement control from the refreshed element in the Data Sources area. You’ll have to do this for the following schema changes:
- Changing the name of an element
- Changing an element’s type from a simple type to a complex type and vice versa.
- Moving a child element to a different parent
- Deleting an element
- Adding or removing data type restrictions
- Changing an element from non-repeating to repeating or vice versa
- Increasing maxOccurs from n to n+1 or more where n>0.
For example, if you add restrictions to limit the possible values in a dropdown control, you will not see the new values until you delete the old control and generate a new one.
The list above is not exhaustive. Generally speaking, the more extensive your schema changes are, the higher the likelihood that you will have to delete the original controls and generate new ones. (Obviously if your schema has changed drastically, you may want to consider creating entirely new forms instead of trying to edit the old ones.)
Some minor schema changes frevvo handles automatically and does not require you to replace the control in the form. For example:
- If you change an element from one simple type to another (e.g., a string to an integer), the corresponding control will change validation accordingly
- If you make an un-required element required by changing the minOccurs from 0 to 1, the corresponding control automatically will be required and marked with a red asterisk—and vice versa if you change the minOccurs from 1 to 0.
The Forms Designer alerts you to any controls for which the schema elements were deleted by displaying them with (placeholder: a brown border) after you have updated your schema. However, deleted elements are not the only reason a control can become unbounded from its corresponding schema element. Elements you update to make repeating are a good example—the “old” controls in your form will not be automatically updated to be a repeat control. You must delete the old control and generate a new one by clicking the icon next to the element name in the Data Sources area.
Although we do not recommend leaving unbounded controls in your form, you are not explicitly prevented from doing so. If you save your form with unbounded controls, data submitted in these controls will be included in the default XML Submission document for the form itself as opposed to being captured in the XML document for the schema.
Deleting Unused Data Source Elements
You do not have to generate a control from every element in the Data Sources area. The Submissions Data tab will show labels only for the controls on your form, and the Submissions XML document will capture only those data elements that users actually entered on your form.
However, keep in mind that a separate XML document is created for each global element you've added to your form, so if you don't need a global element, delete it from the form's Data Sources. Do this by clicking the
icon next to the element's name. As the illustration below shows, you cannot delete child elements of a global element; you must delete the entire parent. If you have created controls for any child element, do not delete the global (parent) element.
Deleting a Schema
If you upload a schema you do not need, you can delete it. Choose Schemas from the left-hand menu and click the
icon next to the name of the schema you wish to delete. (If you are working in the Forms Designer, you must finish or cancel your form to access frevvo's left-hand menu.)
If you choose to do this, be certain that none of your forms rely on elements from this schema. Any forms that use elements from the deleted elements will be adversely affected.






