Set a variable depending on another one

Dear community,
is it possible to set the value of variable Y depending on the current value of variable X (which is set via a dropdown in the App).

As further explanation, here is my usecase (maybe there is a different solution I am not aware of):

I am working on a task, where I have several tables, that should be editable in my App. A user is able to select one of the tables via a dropdown element, edit the selected table and trigger a microservice workflow after editing.
In this workflow I need to load the edited table (which works fine via the variable data_id provided) and additionally a second table where I need to change entries too depending on edited rows.

This second table is not the same, but there is a mapping between the edited table and this second one like:
edited table → second table
A → X
B → Y

So my task is to load both tables (A,X) or (B,Y) depending on which table is selected by the user (A or B). My approach would have been to use a second variable, that will be set by a fixed rule via the first variable.

Thanks in advance!
Christoph

Dear app-builders,
I did not find out if I can set variable B depending on variable A in an app.
However, I was able to solve my usecase by using a variable of type object instead of a simple string variable:

"variables": [
      {
        "name": "var_tableSource",
        "type": "string",
        "default": {
          "source": "source_elementId_1",
          "source_dataId": "source_dataId_1"
        }
      }
    ]

With that I am able to set in my dropdown element

"type": "variableConfigSingleSelect",
      "config": {
        "variable": "var_tableSource",
        "options": [
          {
            "label": "Table 1",
            "id": "var1",
            "origin": "raw",
            "value": {
              "source": "source_elementId_1",
              "source_dataId": "source_dataId_1"
            }
          },
          {
            "label": "Table 2",
            "id": "var2",
            "origin": "raw",
            "value": {
              "source": "source_elementId_2",
              "source_dataId": "source_dataId_2"
            }
          }
        ]

and I can hand it over to my workflow variable by specifying it in the edit-part of the table element.
Thanks @pedro.jaime-gonzalez for the hint :slight_smile:

2 Likes