Here you can find a reference of the different properties that must be contained in the metadata object of the component.
This is the expected structure of the metadata file:
{
"name": "component_name",
"title": "Component title",
"description": "Component description",
"version": "1.0.0",
"icon": "component_icon.svg",
"externalReference": {
"label": "External documentation",
"href": "https://example.com"
},
"cartoEnvVars": [],
"inputs": [
{
"name": "input_table",
"title": "Input table",
"description": "The table to add the column to",
"type": "Table"
}
],
"outputs": [
{
"name": "output_table",
"title": "Output table",
"description": "The table with the column added",
"type": "Table"
}
]
}
Some important notes about the metadata structure:
name
: A unique identifier for the component that matches its folder nametitle
: A human-readable title displayed in the UIdescription
: A brief explanation of what the component doesversion
: The semantic version number of the componenticon
: The SVG icon filename to display (must exist in icons folder)externalReference
: Optional object with label and URL for external documentationlabel
: The label to display in the UIhref
: The URL to the external documentation
cartoEnvVars
: Array of environment variables the component needs access toinputs
: Array of input parameters the component acceptsoutputs
: Array of output parameters the component produces
-
Table
{ "name": "inputtable", "title": "Input table", "description": "The input table", "type": "Table" }
-
Boolean
{ "name": "converttometers", "title": "Convert to meters", "description": "Convert values to meters", "type": "Boolean" //asdfcp }
-
String
{ "name": "selectstatement", "title": "SELECT statement", "description": "The SELECT statement to run", "type": "String" }
-
Number
(it acceptsmin
,max
anddefault
properties){ "name": "distance", "title": "Distance", "description": "The buffer distance", "type": "Number" }
-
Selection
{ "name": "units", "title": "Units", "description": "Units to use", "type": "Selection", "options": ["meters", "miles"] }
-
Column
{ "name": "geocol", "title": "Geo column", "description": "The column containing geometries", "type": "Column", "parent": "source_table" }
It should contain an array of output elements. Since outputs generated by workflow components can only be tables, an output element is defined just like an input table element. For instance:
{
"name": "outputtable",
"title": "Output table",
"description": "The output table",
"type": "Table"
}
You can include an array with the list of environmental variables that your component will need. Those variables will be automatically declared and assigned, and you will have them available to be used in your component code.
These are the variables that are currently supported:
analyticsToolboxDataset
analyticsToolboxVersion
apiBaseUrl
accessToken
dataExportDefaultGCSBucket
bigqueryProjectId
bigqueryRegion
The property is not optional, so, in case you don't need environment variables in your component, use an empty array.