All user inputs are defined in
repository /
template /
version /
src
/
inputs.jsonnet
.
Users must fill in these inputs before the template is applied. In the template Jsonnet files, inputs are referenced using the Input function.
Inputs are divided into steps, and steps are grouped into groups. Each group defines how many steps the user must select. A template must contain at least one group with one step.
Structure of the inputs.jsonnet
file:
stepsGroups
– an array of step groups
description
string – group descriptionrequired
string – define how many steps must be selected by the user
optional
, exactlyOne
, atLeastOne
, zeroOrOne
, all
steps
– an array of steps within the group
icon
– component or common icon, read morename
(string) – step namedescription
(string) – step descriptionbackend
string (optional) – step backend, used to filter transformations for different backendsdialogName
(string) – name of the step presented to the user in the UI dialog (name
is used if empty)dialogDescription
(string) – step description as presented to the user in the UI dialog (description
is used if empty)inputs
– an array of input definitions
id
string – input ID
Input
, e.g., Input("id")
name
string – input namedescription
(string) – input descriptiontype
string – input data type
string
, int
, double
, bool
, string[]
, object
kind
(string) – input visual style, see belowdefault
– default value (must match type
)rules
(string) – comma-separated validation rules, read more about syntaxshowIf
(string) – condition for displaying the input, read more about syntaxoptions
– an array of selectable options (only for kind = select/multiselect
)
value
(string) – option valuelabel
(string) – visible option namecomponentId
(string) – ID of the component to be authorized for (allowed only for kind = oauth
)oauthInputId
(string) – ID of the linked kind=oauth
input (allowed only for kind = oauthAccounts
)Allowed combinations of type
and kind
:
string
input
– single-line texthidden
– single-line text with masked characterstextarea
– multi-line textselect
– drop-down list (one option must be selected)int
input
– single-line textdouble
input
– single-line textbool
confirm
– yes/no promptstring[]
multiselect
– drop-down list (multiple options can be selected)object
oauth
– OAuth authorization (requires componentId
)oauthAccounts
– OAuth account selector (requires oauthInputId
)Example of inputs.jsonnet
:
{
stepsGroups: [
{
description: "Data extraction",
required: "all",
steps: [
{
name: "Awesome API",
description: "Data extraction from Awesome API",
inputs: [
{
id: "api-base-url",
name: "Api Url",
description: "Please enter URL of your API.",
type: "string",
kind: "input",
default: "https://jsonplaceholder.typicode.com/todos/1",
},
]
}
]
}
]
}
There are several places where the template author can specify an icon to be displayed in the UI. For security reasons, it is not possible to load images from external sites.
The icon is defined as a string and can take one of the following forms:
component:<component-id>
e.g., component:keboola.ex-onedrive
(uses the component icon).common:<icon-name>
, e.g., common:upload
(uses an icon from the predefined set).
upload
, download
, settings
, import
The Snowflake writer (data destination) component ID differs accross AWS, Azure, and GCP stacks due to variations in staging storage.
AWS stacks: keboola.wr-db-snowflake
Azure stacks: keboola.wr-snowflake-blob-storage
GCP stacks (BigQuery backend): keboola.wr-db-snowflake-gcs
GCP stacks (Snowflake backend): keboola.wr-db-snowflake-gcs-s3
"<keboola.wr-snowflake>"
in inputs.jsonnet
for the icon
field.Each user input can have validation rules
.
,
.=
.required,min=0
specifies that the value cannot be empty and must be 0
or more.Each user input can have a showIf
condition, allowing inputs to be dynamically shown or hidden based on previous values.
[<input-id>]
.[some-previous-input] == 'value'
means that the input will only be displayed if some-previous-input
has the value value
.Definition in inputs.jsonnet
:
{
stepsGroups: [
{
description: "Data extraction",
required: "all",
steps: [
{
name: "Awesome API",
description: "Data extraction from Awesome API",
inputs: [
{
id: 'my-string',
name: 'My String',
description: 'Input Description',
type: 'string',
kind: 'input',
rules: 'required',
default: 'default value',
showIf: "[some-previous-input] == 'value'",
},
]
}
]
}
]
}
CLI dialog:
Input Description
? My String: (default value) foo bar
Definition in inputs.jsonnet
:
{
stepsGroups: [
{
description: "Data extraction",
required: "all",
steps: [
{
name: "Awesome API",
description: "Data extraction from Awesome API",
inputs: [
{
id: 'my-string',
name: 'My String',
description: 'Input Description',
type: 'string',
kind: 'hidden',
rules: 'required',
showIf: "[some-previous-input] == 'value'",
},
]
}
]
}
]
}
CLI dialog:
Input Description
? My String: **********
Definition in inputs.jsonnet
:
{
stepsGroups: [
{
description: "Data extraction",
required: "all",
steps: [
{
name: "Awesome API",
description: "Data extraction from Awesome API",
inputs: [
{
id: 'my-string',
name: 'My String',
description: 'Input Description',
type: 'string',
kind: 'textarea',
rules: 'required',
default: 'default value',
showIf: "[some-previous-input] == 'value'",
},
]
}
]
}
]
}
CLI dialog:
Input Description
? My String: [Enter to launch editor]
The value is edited in the editor defined by the EDITOR
or VISUAL
environment variable.
Definition in inputs.jsonnet
:
{
stepsGroups: [
{
description: "Data extraction",
required: "all",
steps: [
{
name: "Awesome API",
description: "Data extraction from Awesome API",
inputs: [
{
id: 'my-string',
name: 'My String',
description: 'Input Description',
type: 'string',
kind: 'select',
rules: 'required',
default: 'value2',
showIf: "[some-previous-input] == 'value'",
options: [
{
value: 'value1',
label: 'Name 1',
},
{
value: 'value2',
label: 'Name 2',
},
{
value: 'value3',
label: 'Name 3',
},
],
},
]
}
]
}
]
}
CLI dialog:
Input Description
? My String: [Use arrows to move, type to filter]
Name 1
> Name 2
Name 3
Definition in inputs.jsonnet
:
{
stepsGroups: [
{
description: "Data extraction",
required: "all",
steps: [
{
name: "Awesome API",
description: "Data extraction from Awesome API",
inputs: [
{
id: 'my-int',
name: 'My Int',
description: 'Input Description',
type: 'int',
kind: 'input',
rules: 'required',
default: 123,
showIf: "[some-previous-input] == 456",
},
]
}
]
}
]
}
CLI dialog:
Input Description
? My Int: (123) 789
Definition in inputs.jsonnet
:
{
stepsGroups: [
{
description: "Data extraction",
required: "all",
steps: [
{
name: "Awesome API",
description: "Data extraction from Awesome API",
inputs: [
{
id: 'my-double',
name: 'My Double',
description: 'Input Description',
type: 'double',
kind: 'input',
rules: 'required',
default: 123.45,
showIf: "[some-previous-input] == 456.78",
},
]
}
]
}
]
}
CLI dialog:
Input Description
? My Double: (123.45) 789.12
Definition in inputs.jsonnet
:
{
stepsGroups: [
{
description: "Data extraction",
required: "all",
steps: [
{
name: "Awesome API",
description: "Data extraction from Awesome API",
inputs: [
{
id: 'my-bool',
name: 'My Bool',
description: 'Input Description',
type: 'bool',
kind: 'confirm',
rules: 'required',
default: true,
showIf: "[some-previous-input] == true",
},
]
}
]
}
]
}
CLI dialog:
Input Description
? My Bool: (Y/n)
Definition in inputs.jsonnet
:
{
stepsGroups: [
{
description: "Data extraction",
required: "all",
steps: [
{
name: "Awesome API",
description: "Data extraction from Awesome API",
inputs: [
{
id: 'my-string-array',
name: 'String Values',
description: 'Input Description',
type: 'string[]',
kind: 'multiselect',
rules: 'required',
default: ['value2', 'value3'],
options: [
{
value: 'value1',
label: 'Name 1',
},
{
value: 'value2',
label: 'Name 2',
},
{
value: 'value3',
label: 'Name 3',
},
],
},
},
]
}
]
}
]
}
CLI dialog:
Input Description
? String Values: [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
> [ ] Name 1
[x] Name 2
[x] Name 3
The OAuth authorization input (kind=oauth
) is fully supported only in the UI.
componentId
field).oauth
input is used in the CLI, it will leave the value empty.Definition in inputs.jsonnet
:
{
stepsGroups: [
{
description: "Data extraction",
required: "all",
steps: [
{
name: "Awesome API",
description: "Data extraction from Awesome API",
inputs: [
{
id: 'my-oauth',
name: 'oAuth',
description: 'oAuth Authorization',
type: 'object',
kind: 'oauth',
componentId: 'keboola.ex-google-ads'
},
]
}
]
}
]
}
Input usage in a config.jsonnet
:
{
authorization: {
oauth_api: Input("my-oauth"),
},
}
CLI output:
Template "keboola/my-template-id/1.2.3" has been applied, instance ID: inst12345
The template generated configurations that need OAuth authorization. Please follow the links and complete the setup:
- https://connection.keboola.com/admin/projects/123/components/ex-generic-v2/456789
The OAuth accounts input (kind=oauthAccounts
) is fully supported only in the UI.
kind=oauth
input via the oauthInputId
field.Definition in inputs.jsonnet
:
{
stepsGroups: [
{
description: "Instagram",
required: "all",
steps: [
{
name: "Instagram",
description: "Data extraction from Instagram",
inputs: [
{
{
id: "my-oauth",
name: "Instagram oAuth",
description: "Instagram Authorization",
type: "object",
kind: "oauth",
componentId: "keboola.ex-instagram",
},
{
id: "my-oauth-accounts",
name: "Instagram Profiles",
description: "Instagram Profiles",
type: "object",
kind: "oauthAccounts",
oauthInputId: "my-oauth",
},
]
}
]
}
]
}
Inputs usage in a config.jsonnet
:
{
authorization: {
oauth_api: Input("my-oauth"),
},
parameters: Input("my-oauth-accounts") + {
other1: "value1",
other2: "value2",
}
}
The OAuth accounts input can only be used with the components listed below:
Example value for profiles
mode:
{
"profiles": [
{
"id": "PROFILE_ID",
"name": "All Web Site Data",
"webPropertyId": "WEB_PROPORTY_ID",
"webPropertyName": "WEB_PROPRTY_NAME",
"accountId": "ACCOUNT_ID",
"accountName": "ACCOUNT_NAME"
}
]
}
Example value for properties
mode:
{
"properties": [
{
"accountKey": "accounts/ACCOUNT_ID",
"accountName": "ACCOUNT_NAME",
"propertyKey": "properties/PROPERTY_ID",
"propertyName": "PROPERTY_NAME"
}
]
}
Example value:
{
"customerId": ["1234abcd"],
"onlyEnabledCustomers": true
}
Example value:
{
"accounts": {
"act_12345678": {
"account_id": "12345678",
"business_name": "",
"currency": "CZK",
"id": "act_12345678",
"name": "Jane Doe"
}
}
}
Example value:
{
"accounts": {
"123456789101112": {
"category": "Just for fun",
"category_list": [
{
"id": "9876543210000",
"name": "Just for fun"
}
],
"name": "PAGE_NAME",
"id": "123456789101112",
"tasks": [
"ANALYZE",
"ADVERTISE",
"MODERATE",
"CREATE_CONTENT",
"MANAGE"
]
}
}
}
Example value:
{
"accounts": {
"123456789101112": {
"category": "Musician/Band",
"fb_page_id": "9876543210000",
"id": "123456789101112",
"name": "Entita"
}
}
}