Resource Components are the easiest way to create data bound web forms applications. Resources enable the designer to create complex data objects that can be leveraged in forms across an organization. When a resource is added to a form, you have the ability to empower users to add additional resources as necessary, or select from an existing list of resources. Consider a purchase request example.
- When working with a purchase request, it would be common to choose from a list of vendors that have been used previously. It may make sense to create a Resource for Vendor. In the example below, a Vendor Resource is created to capture Vendor Name, Email Address, and Phone Number.
- A request Form can be created to capture the additional details for the request. In the example below, a Form is created to capture Item Description and Amount. Before dropping input components on the form, a Columns Component is added to control overall layout. A Resource Component is added to the Form, and the Submit button is brought into the confines of the Columns Component to bring the Submit action closer to the user's input points.
- It's important to remember when using resources that you must select the correct resource from the Resource drop down in the Settings.
Notice that the Resource Component presents a drop down list of available vendors. To control the data that displays in the Resource's drop down, modify the Item Template property in the Resource Component's settings. Add the Property Name of the component you want to display. In the example above, the field vendorName is added by updating the Item Template to display item.data.vendorName.
By default, a Resource will return all data related to the object, in this case Vendor. The default return will be in JSON format, so in practice it's a good idea to specificy the correct display field up front.
Sample Resource JSON ObjectXML
- The Resource's data can be managed just like any other form. From the GlobalForms landing page, you can generate a link to the Resource just like you can generate a link to a Form by clicking the View button. Any user with appropriate permissions could access the Vendors link and add vendors.
Alternately, you can enable user's to add resource data in line with the Form by enabling the Show Add Resource Button Option and providing text for the associated button.
When resources are added inline, after a new item is added, it is automatically selected.
- When mapping the form to a PDF, all of a selected resources data will be accessible and can be mapped as well. This strategy allows you to build data rich applications without having to clutter your forms with inputs that might not be required.
The example Resource and Form used in this example is attached here.