Dynamic Body Content in Infinity Data Source Query

How is it possible to change the body content of a query depending on the selection in a variable.

The variable is configured as a query and returns this structure:

If I select one value, the body should have this structure:

{
“Parameters”: [
{
“DataSourceKey”: " the selected value 1 from variable Test p.e. Verbrauch",
“From”: “${__from:date}”,
“To”: “${__to:date}”,
“DataKind”: “$Verdichtung”,
“ValueKind”: 0,
“Resolution”: 0
}
]
}

If I select two, then like this:

{
“Parameters”: [
{
“DataSourceKey”: " the selected value 1 from variable Test p.e. Verbrauch ",
“From”: “${__from:date}”,
“To”: “${__to:date}”,
“DataKind”: “$Verdichtung”,
“ValueKind”: 0,
“Resolution”: 0
},
{
“DataSourceKey”: “the selected value 2 from variable Test p.e. Verbrauch Klaus”,
“From”: “${__from:date}”,
“To”: “${__to:date}”,
“DataKind”: “$Verdichtung”,
“ValueKind”: 0,
“Resolution”: 0
}
]
}

etc…

Just like the date variables you have there add the variablename

This also works statically without any problems.
But the question is different. At this moment the body content is, let’s say, hardcoded. I pass the selected variable to each value in the array for the parameter “DataSourceKey”.
My goal is to pass the entire structure of the body content dynamically depending on the selection.

e.g.:

Instead of entering the hardcode in the body:

{
“Parameters”: [

{
“DataSourceKey”: " the selected value 1 from variable Test p.e. consumption",

“From”: “${__from:date}”,

“To”: “${__to:date}”,
“DataKind”: “$Verdichtung”,
“ValueKind”: 0,
“Resolution”: 0
}
]
}

I only won’t insert one parameter e.g. $Var_1 which has the array from above as its content or the array with x values.

2 variables

Var1 is what you currently have, var2 is the body along with dynamic data from var1

No.

The VAR1 turn me this:

In the Dashbord now i can select only MOTOR 1 or MOTOR and MOTOR 3 or ALL MOTOR.

Depending on whether I make one choice or all 3, the structure in the body should change.

With one selection p.e. MOTOR 1

{
“Parameters”: [
{
“DataSourceKey”: “DV_1”,
“From”: “${__from:date}”,
“To”: “${__to:date}”,
“DataKind”: “$Verdichtung”,
“ValueKind”: 0,
“Resolution”: 0
}
}

With two selection p.e. MOTOR 1 + MOTOR 3

{
“Parameters”: [
{
“DataSourceKey”: “DV_1”,
“From”: “${__from:date}”,
“To”: “${__to:date}”,
“DataKind”: “$Verdichtung”,
“ValueKind”: 0,
“Resolution”: 0
},
{
“DataSourceKey”: “DV_3”,
“From”: “${__from:date}”,
“To”: “${__to:date}”,
“DataKind”: “$Verdichtung”,
“ValueKind”: 0,
“Resolution”: 0
}
}

For the DataSourceKey parameter, the value DV_1 or DV_2 etc. must be passed.
I hope I have explained it correctly now.

Actualy when i select only one is function in this way:

{
“Parameters”: [
{
“DataSourceKey”: “${VAR1}”,
“From”: “${__from:date}”,
“To”: “${__to:date}”,
“DataKind”: “$Verdichtung”,
“ValueKind”: 0,
“Resolution”: 0
}
}

{$VAR1} turn mi in this case the value DV_1

With more selection i not found the solution.

that plugin cannot that