Skip to main content

Input params

Process edition includes a second editor, in this case a JSON one.

This is used to define the process input parameters, that will be rendered as a form to ask users for information to start one execution.

Then you could read this parameters object using the helper:

const {
context: { parameters },
} = yepcode;

With parameters definition you could ask for any input needed to run your process.

The JSON that defines input params follows json-shema definition.

This input parameters definition can be tested to check how the form will be rendered, so feel free to change and test until you can ask for all the needed information.

This form specification supports validations, and it would be used on form submit, but that validation won't be checked if execution is started using non submit form methods (ie: webhooks).

Here you have a full JSON schema sample ready to be pasted in the input params editor:

{
"title": "User registration form title",
"description": "This is a sample form specification showing all attribute types",
"type": "object",
"properties": {
"name": {
"title": "Your name",
"type": "string"
},
"password": {
"title": "Your password",
"type": "string",
"isSensitive": true,
"ui": {
"ui:placeholder": "Use a secure password"
}
},
"birthYear": {
"title": "Birth year",
"description": "Values must be between 1900 and 2021",
"type": "integer",
"minimum": 1900,
"maximum": 2021
},
"withYepCodeAccount": {
"title": "I have a YepCode account",
"type": "boolean"
},
"location": {
"title": "Where do you live?",
"description": "It's a geographical coordinate.",
"required": [
"latitude",
"longitude"
],
"type": "object",
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180
}
}
},
"previousCompanies": {
"title": "What companies have you worked for?",
"type": "array",
"items": {
"type": "string"
}
},
"referals": {
"title": "Tell us about some co-worker referals",
"type": "array",
"items": {
"type": "object",
"properties": {
"referalName": {
"description": "Referal person name",
"type": "string"
},
"referalEmail": {
"description": "Referal person email",
"type": "string"
}
}
}
},
"yourFavoriteProgrammingLanguage": {
"type": "string",
"title": "Your favorite programming language?",
"ui": {
"ui:placeholder": "Pick one option"
},
"enum": [
"Javascript",
"Java",
"Kotlin",
"Ruby",
"Php",
"Pascal",
"Cobol"
]
},
"otherProgrammingLanguages": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Javascript",
"Java",
"Kotlin",
"Ruby",
"Php",
"Pascal",
"Cobol"
]
},
"title": "Other programming languages you have worked with?"
}
},
"required": [
"name",
"birthYear"
]
}