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 anaccount_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 ("_").
- Value must consist only of characters "a-z" (lowercase), "0-9" or "_" (underscore), and must be between 1-100 characters long (regex:
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 thescopes
property).
- Currently, only one value is available:
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.
- Value must be one of:
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
.
- Values must be one or more of:
description
string / optional / max: 255: The description displayed in smaller text above the configuration field in the Uberflip application (below the value oflabel
).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.
- Value requirement is determined by the
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 oftext
andvalue
properties. See below for further details.
- Value must be one or more of:
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.
- Value must be one or more of:
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
.
- Values must match values of
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
.
- Values must match values of
Control Types, Props and Validations
Control Types & Compatibility
Control Type | Description | Control Props | Validations |
---|---|---|---|
textbox | Single-line field that accepts text input | placeholder | maxlength |
textarea | Multi-line (large) field that accepts text input | placeholder | maxlength |
toggle | Boolean toggle switch | None | None |
number | Numerical input field with increase/decrease buttons | prefix postfix | min max decimals |
select_dropdown | Dropdown list that contains a predefined set of label/value pairs | items | None |
color_picker | Widget that displays a visual selector for color values | None | None |
Default Values
Control Type | Description | Requirements |
---|---|---|
textbox | Default alphanumeric value | string max: 255 |
textarea | Default alphanumeric value | string max: 255 |
toggle | Default state of the toggle control, i.e. on or off | boolean |
number | Default numeric value | numeric |
select_dropdown | Default dropdown item selection | numeric |
color_picker | Default Hex or RGBA value | hex 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)
- Contents of parentheses may be separated with or without a space after the comma, e.g.
Control Props
Control Prop | Applicable Control Type(s) | Description | Requirements |
---|---|---|---|
placeholder | textbox textarea select_dropdown | Placeholder text displayed in textbox or select_dropdown controls | string |
prefix | number | Label displayed to left of (before) number control | string max: 36 |
postfix | number | Label displayed to right of (after) number control | string max: 36 |
items | select_dropdown | List of text and value pairs used to populate the select_dropdown control | array (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 byname
) when a user uses the dropdown control type to select the correspondingtext
value.
Validations
Validation | Applicable Control Type(s) | Description | Requirements |
---|---|---|---|
maxlength | textbox textarea | Defines maximum accepted string length in textbox control | numeric integer min: 1 max (textbox): 255 max (textarea): 4000 |
min | number | Defines minimum accepted value in number control | numeric |
max | number | Defines maximum accepted value in number control | numeric |
decimals | number | Defines amount of decimal places displayed/stored for a value in number control | numeric 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.
Updated 10 months ago