LogoLogo
Getting StartedDevelopersDeployment GuideGet Help
  • Quick Links
  • Welcome to Form.io
    • Getting Started With Form.io
    • Launch a Form
    • Overview of Form.io
  • Developer Tool Ecosystem
    • PDF Solution
    • Enterprise Form Builder
    • Form View Pro
    • The Security Module
    • Accessibility Compliance Module
    • Developer License
    • SQL Connector - Deprecated
    • Integration Libraries
    • Form.io CLI Tool
  • User Guide
    • Introduction
    • Form.io Developer Portal
    • Teams
    • Projects
      • Project UI
      • Project Settings
      • Stages
      • Multi-Tenancy
    • Resources
      • ResourceJS
    • Forms
      • Form Creation
      • Form Types
      • PDF Forms
      • Embedding a Form
      • Form Revisions
      • Form Settings
    • Form Building
      • Form Builder UI
      • Form Components
        • Component Settings
        • Basic Components
          • Resource as Select Component Data Source
        • Advanced Components
        • Layout Components
        • Data Components
        • Premium Components
          • Nested Forms
        • Custom Components
      • Logic & Conditions
      • Existing Resource Fields
      • Actions
    • Submissions
      • Accessing Submissions
      • Importing Submissions
    • Form.io eSignature - Coming Soon
    • Form.io Reporting Module
    • PDF Template Designer
    • Form View Pro
    • Form Manager
    • Enterprise Form Builder Module
      • Installation
      • User Guide
  • Developer Guide
    • Introduction
      • Application Development
      • API Documentation
    • Form Development
      • Form Renderer
      • Form Builder
      • Form Embedding
      • Form Evaluations
      • Form Templates
      • Custom Components
      • Translations
    • JavaScript Development
      • JavaScript SDK
      • JavaScript Frameworks
      • JavaScript Utilities
    • Authentication and Authorization
      • SAML
      • OAuth
      • LDAP
      • Resource Based Authentication
      • Email Authentication
      • Two-Factor Authentication
    • Roles and Permissions
      • Field Match-Based Access
      • Field-Based Resource Access
      • Group Permissions
    • Integrations
      • Email Integrations
      • File Storage
      • Google Developer Console
      • eSign Integrations
      • Relational Databases
    • Modules
    • Fetch Plugin API
    • CSS Frameworks
    • Offline Mode
    • Audit Logging
  • Deployments
    • Self-Hosted Deployment
      • Local Deployment
        • Local File Storage
      • Kubernetes
      • Cloud Deployment
        • AWS Deployment
          • AWS Lambda
          • Form.io/AWS Elastic Beanstalk End-To-End Encrypted Deployment
        • Azure Deployment
          • Azure App Service
            • Azure MSSQL Connector - Deprecated
          • Azure Virtual Machine
          • Azure Kubernetes Service
          • Set up the DB
        • GCP Deployment
          • GCP Cloud Run
      • On-Premise Deployment
      • Enterprise Server
      • PDF Server
    • Deployment Configurations
      • DNS Configuration
      • Load Balancer Configuration
    • Licenses
      • License Management
      • Library Licenses
    • Portal Base Project
      • Portal SSO
      • Portal Translations
    • Maintenance and Migration
      • Changes to Premium Libraries
  • FAQ
    • FAQ
    • Tutorials & Workflows
      • Password Reset
      • Dynamic Select Filtering
      • Approval Workflow
      • SSO Email Token
      • Embedding A Video
      • Data Source Validation
      • Select Data Source Options
      • Nested Form Workflows
        • Nested Wizard Forms
      • Save as Draft
      • Role-Based Conditions
      • Custom Component
      • Dynamic Radio and Select Box Values
      • Override CKEDITOR
    • Errors
    • Examples
    • License Utilization Checks
    • Glossary of Key Concepts
  • Contact Us
Powered by GitBook
On this page

Was this helpful?

  1. User Guide
  2. Form Building
  3. Form Components
  4. Basic Components

Resource as Select Component Data Source

Additional information and design considerations when using a Resource as the Data Source for a Select Component.

PreviousBasic ComponentsNextAdvanced Components

Last updated 5 months ago

Was this helpful?

Using a Resource as the Data Source for the selectable choices in a Select Component is a common workflow. This permits, for example, user-defined data to be incorporated into the Select Component's choices. As the Resource is polled when the Form is rendered, the choices available in the Select Component can vary significantly between uses, which can significantly alter the data included in a Form submission.

When choosing to use a Resource as the Data Source for a Select Component, it is important to consider how Resource data is managed and what impact this has on Submission data. One important consideration to this end is the "Save as reference" option available in the Select Component settings.

To examine the impact of this option, consider the following Transport Request Form with a Driver Select Component that is populated from a Driver Resource.

The value chosen within the Select Component is stored in the Submission Data as expected:

After editing the resource, any submissions recorded while the Select component was configured to "Save as reference" will reflect the update:

Note that even though the data recorded was updated, and the Resource's "Updated" field reflects the time, the original submission's "Updated" time does not change.

In contrast, the Submission of the form where "Save as reference" is not configured will retain the same data:

Data Stability and Race Conditions

It is important to consider that when using a Resource as the Data Source for a Select Component, multiple actors within the project may be editing the Resource at any time. If the Resource is configured with "Save as reference," it is possible for Submission data to change if the resource is edited any time after the Submission is recorded. When this effect is intended, it is important to factor this into the application as a whole, as cached versions of the Submission data may not reflect such updates. Be careful to account for all downstream considerations that may arise when Submission data is configured to change synchronously with the Resource field.

Additionally, it is important to remember that a Form may directly or indirectly affect a Resource used as a Data Source within itself. This can create unanticipated and unpredictable behavior. Ensure that all workflows within the application that may alter a Resource that is used as a Data Source are sufficiently decoupled from processes that rely on that Resource as an input.

The following diagrams illustrate the relationship between the Select Component, the Resource, and the Submission, and the way the "Save as reference" option affects this relationship.

In the first example, the Resource supplies selectable fields for the Select Component's drop down. When one of these is selected and the form is submitted, the Submission will record the selected value as it was stored in the Resource at the time of the submission.

In the next illustration, the Resource is modified, but "Save as reference" is not selected. As a result, only submissions made after the change will reflect the alteration.

In the final illustration, "Save as reference" is selected. As a result, the previously recorded submission will reflect the change to the Resource, even if no new submission is made.

As with the , enabling the "Save as reference" function affects the way edited Submissions are recorded. When "Save as reference" is enabled, editing the resource following a submission will update the data in the recorded submission:

Nested Form component
Choices availalable when Data Source is set to Resource.
The Select Component data source is a Resource.
The Driver resource used to populate the Select Component
Submission Data with the Driver recorded.
Editing a submission of the Driver Resource.
The Resource Data tab, reflecting the update.
The updated field is reflected in the Form Submission Data.
Data remains unchanged when "Save as reference" is not configured.
The Resource serves as the Data Source for the Select Component. The selected field is submitted.
Without "Save as reference" configured, only new Submissions will store an edited value.
The previously recorded Submission may be changed when "Save as Reference" is enabled.