...
The Doc URI Approach | Post via Web Hook | The Business Rules Approach | Dynamic Options | |
---|---|---|---|---|
Overview | Automatically create the controls in your form based on your database table, and use the Document Action user interface to set up Doc URIs that can perform CRUD Operations. | Automatically post data from your form/workflow to your database mid-workflow using the Web Hook feature. | Write JavaScript business rules to perform CRUD operations. | Dynamically retrieve options at runtime from the Database Connector (or any RESTful web service) using the Options Src control property, no code needed. |
Recommended Use Cases |
|
|
|
|
Form Design |
|
|
| Use Checkbox, Dropdown, Radio or ComboBox control with the from palette design method. |
Performance | Call the DB Connector once for all operations (using the autocreate feature) → fast, reliable performance | Call the DB Connector once after the prior step unloads (Continue is clicked). | Call the DB Connector query for every add/update operation (this can impact performance) | Calls the DB connector for each instance of the selection control. Fast, reliable performance for non-repeating controls. Performance issues may be seen for repeating controls. |
Technical Skills | No code needed Create/Modify xsd schema document | No code needed Create/Modify xsd schema document | JavaScript code required | No code needed |
Documentation | Generating XML Schema | Data Sources | CRUD Operations Example | 10-Minute Doc URI Video | Post via Web Hook | Forms Designer | Palette Controls | Integrations | Business Rules HTTP Methods | Rule Examples | Control Property Settings - Dynamic Options |
...
This is the recommended approach because it involves automatically generating controls in your form based on the database table you will be integrating with, and using the no-code Document Action: Manually Set Doc URIs to perform CRUD Operations on your database. The Doc URI Approach must be used with the "from an XML schema" design method. Follow these steps.
- Generate the XML Schema based on your SQL Statements that allows you to add form controls that match your database table columns.
- Add Form Controls from Schema in the form/workflow designer.
- Set Doc URIs to automatically read from and write to the database.
...
To use your schema, first, upload the schema in the Schemas tab of your frevvo Project. Visit the Using Your Schema documentation for detailed steps.
Next, open your form or workflow and add one or more elements from schema in the Data Sources panel. This allows you to generate controls from the schema elements that map to your database tables. See the Data Sources chapter for detailed steps.
Set Document URI Properties
...
Excerpt | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
After you have generated controls from the elements in your database schema, set your form’s Document URI to the database connector query URL. Follow these steps:
The first section in the wizard is for the form's default document. This is indicated by the Document Name of "default" displayed in the wizard. The default document maps to all of the controls you added to this form by dragging and dropping from the palette. This is typically not the document you want to configure.
The next screen has two sections: Read URI and Write URI. Typically, when the form loads, frevvo customers read form data from their database to initialize the form and send the updated XML document to the same database upon form submission. Enter the same URI in the Read URI and the Write URI fields, as shown in the image, with the appropriate SQL statement to run if you are reading from and writing to the same database using the database connector. It is possible to read the form initialization data from one database and then update a different database. Enter different URIs in the Read URI and the Write URI fields if this is your situation.
You also must specify which of the four SQL statements to run—you do this by choosing the appropriate values in the Document URI Read Method and Document URI Write Method dropdowns according to the table below. (You may notice in the Forms Designer that the Document URI Read Method drop down box includes a POST option, but it is not shown below because it is not used by the database connector.)
You’ll see one set of Document URI properties for each schema in your form. Type the Document URI next to the schema name—make sure not to type it next to the Default schema. To specify which of the four SQL statements to run, choose the appropriate values in the Read Method and Write Method dropdowns, based on the information below.
Note that you may choose only one Write Method in the Forms Designer. |
...
- In Workflow Editing Mode, click the + icon after the step that should post data to your database.
- Select Add web-hook (HTTP POST)
- Enter the Database URL for the query that contains your create statement, e.g. http://localhost:8082/database/products/allProducts. Be sure to check the Data checkbox. Click Submit.
You will see the Web Hook displayed in your workflow diagram, and you can edit it at any time. The Database Connector will run the create statement to post data after the user clicks Continue on Step 1.
...
It is also possible to write business rules to perform CRUD operations. Business rules tend to be more complex and time-intensive to implement. The Business Rule Approach can be used with either the "from palette" or the "from an XML schema" design method. This approach is discussed in further detail with several examples in the following documentation:
...