Hello everyone,
I try to pass a value from a variableInput Field to a workflow and trigger the workflow with this variable.
The trigger works, but unfortunately the passing of the variable didn’t seem to work. Do you have an idea?
This is the config:
Execute-Button:
{
"id": "button_search_ele",
"type": "executeButton",
"config": {
"label": "Search for XYZ",
"endpoint": "XYZ_search_endpoint",
"endpointParameters": [
{
"name": "XYZ_variable",
"type": "STRING",
"valueFromVariable": "",
"$valueFromVariable": {
"value": "{{var_searchField_ele.XYZ_variable}}"
}
}
],
"icon": "",
"messages": {
"started": {
"headline": "Verarbeiten",
"message": "Es wird nach der XYZ gesucht."
},
"error": {
"headline": "Error",
"message": "Es ist ein Fehler in der Suche aufgetreten."
},
"failed": {
"headline": "Failed",
"message": "Die Suche konnte nicht ausgeführt werden."
},
"aborted": {
"headline": "Aborted",
"message": "Die Suche wurde abgebrochen."
},
"success": {
"headline": "SUCCESS",
"message": "Die Suche wurde erfolgreich ausgeführt."
},
"hideAfterSeconds": 15,
"disabled": false
}
}
}
Endpoint:
{
"id": "XYZ_search_endpoint",
"type": "workflow",
"config": {
"workflowId": "fde02293-579c-4b3f-a8f4-4d96604f628e",
"projectId": "0fee8538-18e6-433e-a4da-eb835d9b54ec",
"version": 4,
"endpointParameters": [
{
"name": "XYZ_variable",
"type": "STRING",
"valueFromVariable": "TEST",
"$valueFromVariable": {
"value": "{{var_searchField_ele.XYZ_variable}}"
}
}
]
}
}
VariableInput:
{
"id": "var_searchField_ele",
"type": "variableInput",
"config": {
"variable": "XYZ_variable",
"inputType": "input",
"label": "Insert XYZ"
}
}
I try to see if it works via the variable-manager in the workflow - if the value inside is changed, it worked. Unfortunately the value of the variable didn’t change.
Thank you very much for your help.
EDIT:
Here is the right configuration for the endpoint.
You have to insert the variablename in the property “ValueFromVariable” without the brackets.
{
"id": "button_search_ele",
"type": "executeButton",
"config": {
"label": "Search for XYZ",
"endpoint": "XYZ_search_endpoint",
"endpointParameters": [
{
"name": "xyz_variable",
"type": "STRING",
"valueFromVariable": "searchfield_variable"
//This was the wrong approach, don't do it like that
// "$valueFromVariable": {
// "value": "{{searchfield_variable}}"
// }
}
],
"icon": "",
"messages": {
"started": {
"headline": "Verarbeiten",
"message": "Es wird nach der XYZ gesucht."
},
"error": {
"headline": "Error",
"message": "Es ist ein Fehler in der Suche aufgetreten."
},
"failed": {
"headline": "Failed",
"message": "Die Suche konnte nicht ausgeführt werden."
},
"aborted": {
"headline": "Aborted",
"message": "Die Suche wurde abgebrochen."
},
"success": {
"headline": "SUCCESS",
"message": "Die Suche wurde erfolgreich ausgeführt."
},
"hideAfterSeconds": 15,
"disabled": false
}
}
}