Skip to content

sc-static-value

1 Purpose

The purpose of sc-static-value is to define one or more static values for inclusion in each saved document.

Unlike other components, sc-static-value results in a blank space rather than a visible field on a form. Defining sc-static-value with "visible": false will prevent the creation of the blank space on the form.

The sc-static-value definition provides fields for setting the properties of a static value field and is fully described below.

 

2 Definition

sc-static-value is defined by a set of name/value pair fields consisting of:

  • Required system fields
  • Required customizable fields
  • Optional customizable fields

Note:

  1. Default values for fields described in the tables below are shown in bold text.
  2. As the sc-static-value field appears as a blank space on the form, it is recommended defining it with "visible": false.

2.1 Required System Fields

Field Valid Values Description
componentName sc-static-value The component name.
Example: "componentName": "sc-static-value"

2.2 Required Customizable Fields

Field Valid Values Description
name Any value written in camel case. Defines the name of the static value field in the document and database.
Example 1: "name": "testScStaticValue"
value Text, numeric, or boolean One or more text, numeric or boolean values.
Multiple values must be written as an array and must be of the same type (i.e. all text or all numeric).
Example 1: A "value" field with 1 text value
"value": "formbird"
OR alternatively written as an array
"value": [
      "formbird",
]
Example 2: A "value" field with 4 text values
"value": [
      "formbird",
      "Support",
      "123",
      "true",
]
Example 3: A "value" field with a boolean value
"value": true
Example 4: A "value" field with 1 numeric value
"value": 5
Example 5: A "value" field with 5 numeric values
"value": [
      1,
      2,
      3,
      4,
      5,
]
visible false It is recommended defining sc-static-value with "visible": false, to prevent the creation of the blank space that would otherwise occur on the form.
Example: "visible": false
true Default value. The sc-static-value field displays as a blank space on the form.

 

3 Typical sc-static-value Definition

Below is a typical sc-static-value definition, defined with its required fields.

        {
            "componentName": "sc-static-value",
            "name": "testScStaticValue4",
            "value": [
                "formbird",
                "Support"
            ],
            "visible": false
        }

Note: The sc-static-value definition does not have any optional fields.


 

4 Examples

Example 1

Typically a template will include one sc-static-value definition. To illustrate how different data types are treated, this example has 10 sc-static-value definitions.

  • In the 1st, 2nd and 3rd definitions, the "value" field has 1 text value.
  • In the 4th definition, the "value" field has 3 text values.
  • In the 5th definition, the "value" field has 1 numeric value.
  • In the 6th definition, the "value" field has 5 numeric values.
  • In the 7th definition, the "value" field has a boolean value.
        {
            "componentName": "sc-static-value",
            "name": "testScStaticValueText1",
            "value": "ABC"
            "visible": false
        },
        {
            "componentName": "sc-static-value",
            "name": "testScStaticValueText2",
            "value": "123"
            "visible": false
        },
        {
            "componentName": "sc-static-value",
            "name": "testScStaticValueText3",
            "value": "true"
            "visible": false
        },
        {
            "componentName": "sc-static-value",
            "name": "testScStaticValueText4",
            "value": [
                "ABC",
                "123",
                "true"
            ],
            "visible": false
        },
        {
            "componentName": "sc-static-value",
            "name": "testScStaticValueNumeric1",
            "value": 123
            "visible": false
        },
        {
            "componentName": "sc-static-value",
            "name": "testScStaticValueNumeric2",
            "value": [
                1,
                2,
                3,
                4,
                5
            ],
            "visible": false
        },
        {
            "componentName": "sc-static-value",
            "name": "testScStaticValueBoolean1",
            "value": true
            "visible": false
        }

Note: As with all sc-static-value definitions, the above definitions will not display as fields on the form. However the resulting fields in the document and database will contain these 7 name value pairs.

Resulting field in the document and database after saving a document:

    "testScStaticValueText1": "ABC",
    "testScStaticValueText2": "123",
    "testScStaticValueText3": "true",
    "testScStaticValueText4": [
        "ABC",
        "123",
        "true"
    ],
    "testScStaticValueNumeric1": 123,
    "testScStaticValueNumeric2": [
        1,
        2,
        3,
        4,
        5
    ],
    "testScStaticValueBoolean1": true