Form Definitions
Introduction
Form Definitions are templates that can be used (create by definition) to create forms or other entities, related entities.
See Configuration - Definitions on how to use definitions.
Actions
Are shown in the sidebar drawer for FormDefinitions with formType ‘ACTION’.
An action uses the inputs of a FormDefinition to create a REST request and send it to an internal or external service. Currently FormDefinitions of type ACTION are handled by the FE and are limited to the action part of the FormDefinition. In a later faze we will migrate the functionality to the backend making it available via the API gateway and supporting all other functionality of definitions.
{
"description": "Retrieve historical Umeme data of a meter and store in the Yetu database",
"inputDefinitions": [
{
"id": "imei",
"description": "the unique meter serial",
"label": "imei Number",
"type": "string",
"validations": [
{
"name": "required",
"config": "true"
}
]
},
{
"id": "startDate",
"label": "Start date",
"type": "date",
"validations": [
{
"name": "required",
"config": "true"
}
]
},
{
"id": "endDate",
"label": "End date",
"type": "date",
"validations": [
{
"name": "required",
"config": "true"
}
]
}
],
"action": {
"url": "https://test.be",
"method": "POST",
"type": "internal", // optional, if present the following header will be added (overwrite) to the headers section
// Authorization: 'Bearer ' + <users JWT>
"params": {[param: string]: string | number | boolean | ReadonlyArray<string | number | boolean> }, // optional
"headers": { // optional
"test": "kjjkjk" // one can add any type of header. Add a specific Authorization header for external REST calls
},
"body": {} // JSON object used for a POST or PATCH request
// fields are created using the moustache definition, eg "field1": "{{input1}}" or {{input.id}} for an entity
// optional, if not present we will create a default json object containing all 'inputs'
}
}
Did this answer your question?
😞
😐
🤩