[HELP] Use expression in element-templates

Hi Camunda community !
I’m trying to make an element template in the modeler to simplify request to REST APIs.
I made a dropdown list to select the method name and i want to auto display the associated rest method to avoid a manual dropdown selection.
image
I know that I can use conditions in the template and see below an extract of my code :

Blockquote
{
“id”:“url”,
“label”: “REST Method”,
“description”: “Specify method to use.”,
“type”: “Dropdown”,
“value”: “”,
“constraints”: {
“notEmpty”: true
},
“choices”: [
{ “name”: “findByIdOffreAndCodeEditeur”, “value”: “{{baseUrl}}/offre/{{idOffre}}/{{codeEditeur}}” },
{ “name”: “getBeginDate”, “value”: “{{baseUrl}}/offre/{{idOffre}}/{{codeEditeur}}/beginDate” },
{ “name”: “createSubscription”, “value”: “{{subscriptionBaseUrl}}/souscription” }
],
“binding”: {
“type”: “zeebe:input”,
“name”: “url”
}
},
{
“label”: “REST Method”,
“type”: “String”,
“editable”: false,
“value”: “GET”,
“binding”: {
“type”: “zeebe:input”,
“name”: “method”
},
“condition”: {
“property”: “url”,
“oneOf”: [“{{baseUrl}}/offre/{{idOffre}}/{{codeEditeur}}”,“{{baseUrl}}/offre/{{idOffre}}/{{codeEditeur}}/beginDate”, “{{subscriptionBaseUrl}}/souscription”]
}
},
{
“label”: “REST Method”,
“type”: “String”,
“editable”: false,
“value”: “POST”,
“binding”: {
“type”: “zeebe:input”,
“name”: “method”
},
“condition”: {
“property”: “url”,
“oneOf”: [“{{subscriptionBaseUrl}}/souscription”]
}
},

The problems is that it doesn’t work because GET and POST have the same binding name. It works if i use 2 different name but … I need only one name to use this variable in my worker.

I think that it can be fixed by using an expression in order to calculate the value dynamically.
Is it possible, or do you have some genius idea in order to solve this problem ?

Thanks for your time and have a nice day ! :slight_smile:

Hello Adrien, thanks for raising! We already identified this as a bug, which we track here: Conditional properties are not reliably rendered · Issue #3029 · camunda/camunda-modeler · GitHub

If this problem have been raised as a bug, then instead of using condition, get a same binding with mutually exclusive conditions on inputs will solve my problem !
I hope this problem will be fixed soon because I also need this to set an conditional body that depends on rest method name !
Thanks for your response : :slight_smile: