Object: config_fields

Usage & Structure

Specifies configuration fields that can be used to customize your app's settings. Creating a configuration field exposes a control (such as a textbox) in the Uberflip application that accepts a value set by the user.

When you create a configuration field in a manifest, you are effectively declaring a variable that will be defined by user input. To build functionality around a configuration field, insert the variable into your code in the account_code_blocks object by referencing the name value of the configuration field as the variable name. Any value set by the user in the corresponding configuration field will be dynamically inserted into the variable at runtime.

Configuration fields can be scoped in different ways. The scope determines how broad or narrow a field's effect is within the Uberflip application, and where in the application the configuration field will be exposed. You can scope configuration fields in the following ways:

  • Account level: Makes the configuration field's setting apply to all Hubs under the account.
    • Account level configuration fields appear under Account Settings > Integration > Connected Services > App Configurations.
  • Hub level: Makes the configuration field's setting apply to only a specific Hub.
    • Hub-level configuration fields appear under Hubs > Integrations > App Configurations.
  • Stream level: Makes the configuration field's setting apply to only a specific Stream.
    • Stream-level configuration fields appear under Hubs > Content > Streams > App Configuration.

You can set multiple scopes for any configuration field. Doing so will cause the configuration field to appear in all of the specified locations. In such cases, the value set in the most narrowly-scoped configuration field has priority within that scope, i.e. if both an account-level and a Hub-level value have been set, the Hub-level value will take precedence in the context of that Hub.

As they accept user inputs, configuration fields are the only object which can have both read and write permissions (permissions on all other objects are read-only).

This object consists of one or more config_field objects that each contain the properties listed below.

Properties

  • code string / required: The unique name used to identify the configuration field (internal use by Uberflip only).
    • Create a new configuration field by adding an underscore ("_") before the value.
    • Existing configuration fields can not be referenced.
  • name string / required / max: 100: The unique name used to reference the configuration field in an account_code_blocks object.
    • Value must consist only of characters "a-z" (lowercase), "0-9" or "_" (underscore), and must be between 1-100 characters long (regex: ^[a-z0-9_]+$)
    • Does not require a preceding underscore ("_").
  • ordinal integer / required: The value used to set the order position for this configuration fields relative to other configuration fields for your app.
    • Required even if only one configuration field is defined.
    • Numbering is zero-based.
  • label string / required/ max: 100: The label displayed in larger text above the configuration field in the Uberflip application.
  • category string / required: The UI menu item where the configuration field will be displayed.
    • Currently, only one value is available: integrations (the Integrations menu item under Account Settings and/or Hubs, depending on the value(s) of the scopes property).
  • control_type string / required: The type of UI control used to interact with the configuration field.
    • Value must be one of: textbox, textarea, toggle, number, select_dropdown, color_picker
    • See the table below for details on the available control types.
  • scopes array / required: The level(s) at which the configuration field can be set, and to which it will apply.
    • Values must be one or more of: account, hub, stream.
  • description string / optional / max: 255: The description displayed in smaller text above the configuration field in the Uberflip application (below the value of label).
  • default_value varies / optional: The value which will be used to populate the configuration field by default, if not replaced by a user-defined value.
    • Value requirement is determined by the control_type specified. See the table below for details on requirements for each control type.
  • control_props object / optional: The UI element(s)/option(s) that will be applied to the specified control type.
    • Value must be one or more of: placeholder, prefix, postfix, items
    • Value must be valid for the control_type specified. See the table below for details on which control props are valid for each control type, and how to configure them.
    • If specified, must not be empty.
    • For the select_dropdown control type, control_props is required and must be an array consisting of pairing of text and value properties. See below for further details.
  • validation object / optional: The validation rule(s) that will be applied to inputs in the specified control type.
    • Value must be one or more of: maxlength, min, max, decimals.
    • Value must be valid for the control_type specified. See the table below for details on which control props are valid for each control type, and how to configure them.
    • If specified, must not be empty.
  • read_permission_codes array / optional: The permission(s) which must be held by a user to view the configuration field and its value.
    • Values must match values of global_permissions.global_permission.code.
  • write_permission_codes array / optional: The permission(s) which must be held by a user to edit the configuration field and its value.
    • Values must match values of global_permissions.global_permission.code.

Control Types, Props and Validations

Control Types & Compatibility

Control TypeDescriptionControl PropsValidations
textboxSingle-line field that accepts text inputplaceholdermaxlength
textareaMulti-line (large) field that accepts text inputplaceholdermaxlength
toggleBoolean toggle switchNoneNone
numberNumerical input field with increase/decrease buttonsprefix
postfix
min
max
decimals
select_dropdownDropdown list that contains a predefined set of label/value pairsitemsNone
color_pickerWidget that displays a visual selector for color valuesNoneNone

Default Values

Control TypeDescriptionRequirements
textboxDefault alphanumeric valuestring
max: 255
textareaDefault alphanumeric valuestring
max: 255
toggleDefault state of the toggle control, i.e. on or offboolean
numberDefault numeric valuenumeric
select_dropdownDefault dropdown item selectionnumeric
color_pickerDefault Hex or RGBA valuehex or rgba (see below)

If set, the default_value for color_picker must be a valid CSS hex value or rgba() function value:

  • hex values must be a valid CSS hexadecimal color code, formatted as: #xxxxxx or #xxx, e.g. #ce0058
    • Can be uppercase, lowercase, or mixed
  • rgba() function values must be a valid CSS RGBA color code, formatted as: rgba(x, x, x, y), e.g. rgba(206, 0, 88, 0.5)
    • Contents of parentheses may be separated with or without a space after the comma, e.g. rgba(x,x,x,y)

Control Props

Control PropApplicable Control Type(s)DescriptionRequirements
placeholdertextbox
textarea select_dropdown
Placeholder text displayed in textbox or select_dropdown controlsstring
prefixnumberLabel displayed to left of (before) number controlstring
max: 36
postfixnumberLabel displayed to right of (after) number controlstring
max: 36
itemsselect_dropdownList of text and value pairs used to populate the select_dropdown controlarray (see below)

control_props.items must be an array containing only pairings of text and value properties (must contain at least one pairing):

  • text string / required / max: 25: The value of this property is used as the label that is visible in the dropdown control type.
  • value string / required / max: 255: The value of this property is inserted into the variable (as defined by name) when a user uses the dropdown control type to select the corresponding text value.

Validations

ValidationApplicable Control Type(s)DescriptionRequirements
maxlengthtextbox
textarea
Defines maximum accepted string length in textbox controlnumeric
integer
min: 1
max (textbox): 255
max (textarea): 4000
minnumberDefines minimum accepted value in number controlnumeric
maxnumberDefines maximum accepted value in number controlnumeric
decimalsnumberDefines amount of decimal places displayed/stored for a value in number controlnumeric
integer
min: 0
max: 999

Sample Manifest

"config_fields" : [
   {
     "code": "_EXAMPLE_CONFIG_TEXT",
     "name": "example_textbox",
     "ordinal": 0,
     "label": "Example Textbox",
     "category": "integrations",
     "control_type": "textbox",
     "scopes" : ["account", "hub", "stream"],
     "description": "Type desired setting into the field:",
     "default_value": "Example default setting",
     "control_props":
     {
       "placeholder": "Example default setting"
     },
     "validation":
     {
       "maxlength": 100
     }
   },
	{
     "code" : "_EXAMPLE_CONFIG_DROPDOWN",
     "name" : "example_dropdown",
     "ordinal" : 1,
     "label" : "Example Dropdown",
     "category" : "integrations",
     "control_type" : "select_dropdown",
     "scopes" : ["account", "hub", "stream"],
     "description" : "Select desired value:",
     "default_value": 0,
     "control_props": 
    {
       "placeholder": "Please select option",
       "items": [
         {"text": "Option 1", "value": "option_1"},
         {"text": "Option 2", "value": "option_2"}
       ]
    },
     "write_permission_codes": ["_GP_WRITE"],
     "read_permission_codes": ["_GP_READ"]
}
]

Referencing

Configuration fields created with this object can be referenced only in an account_code_blocks object.