Preselect Values in multiSelect Filter with a Variable

Dear App Builders, is there a way to hand over a variable to the “selectedFilter” Property of a multiSelect Filter? I tried several things e.g. to transform my Object Variable to a list, sqlList but none of those ideas worked.

Already Posted Chat HIstory:
Max Toball: Basically, a list should work (make sure to also specify the type as “object” where the variable is applied). However, the behavior is all over the place. This is a known issue (ABVI-640), but as the solution is not clear, it has not been tackled.

Johannes S: So, i tried it with following configuration, which did not work. ALso adding a " | list" in the filter did not help out here. Do you have an idea what i am doing wrong?


Variable_definition

Max Toball: Works with this Config

{
“datasources”: [
{
“id”: “/common/common.source”,
“origin”: “raw”,
“config”: {
“schema”: “table”,
“data”: [
{
“Categories”: “Jan”,
“Berlin”: 1.5,
“Tokyo”: 2.2,
“New York”: 2.3,
“London”: 1.1
},
{
“Categories”: “Feb”,
“Berlin”: 2.1,
“Tokyo”: 2.8,
“New York”: 2.9,
“London”: 3.1
},
{
“Categories”: “Mar”,
“Berlin”: 1.2,
“Tokyo”: 2.8,
“New York”: 2.1,
“London”: 2.4
},
{
“Categories”: “Apr”,
“Berlin”: 0.2,
“Tokyo”: 4.2,
“New York”: 3.7,
“London”: 2.5
}
],
“filterOptions”: {
“distinctValues”: true
}
}
}
],
“endpoints”: ,
“layouts”: [
{
“id”: “/mainPage/main.fixedGrid”,
“type”: “fixedGrid”,
“config”: {
“dim”: {
“x”: 24,
“y”: 24
},
“containers”: [
{
“id”: “titlePos”,
“pos”: {
“x”: 1,
“y”: 1
},
“size”: {
“w”: 24,
“h”: 4
}
},
{
“id”: “table”,
“pos”: {
“x”: 1,
“y”: 4
},
“size”: {
“w”: 24,
“h”: 10
}
},
{
“id”: “chart”,
“pos”: {
“x”: 1,
“y”: 15
},
“size”: {
“w”: 24,
“h”: 10
}
}
]
},
“cellPadding”: “5px”,
“placements”: [
{
“containerId”: “titlePos”,
“elementId”: “/mainPage/title.html”
},
{
“containerId”: “table”,
“elementId”: “/common/tableComponent/common.table”
},
{
“containerId”: “chart”,
“elementId”: “/common/chartComponent/chartVis.filter”
}
]
}
],
“pages”: [
{
“id”: “/mainPage/main.page”,
“screens”: [
{
“layout”: “/mainPage/main.fixedGrid”
}
]
}
],
“partials”: ,
“screens”: ,
“syncSets”: ,
“elements”: [
{
“id”: “/common/chartComponent/chartVis.filter”,
“type”: “filter”,
“source”: “/common/common.source”,
“config”: {
“column”: “Categories”,
“columnType”: “STRING”,
“$selectedFilter”: {
“type”: “object”,
“value”: “{{preselection}}”
}
}
},
{
“id”: “/common/tableComponent/common.table”,
“type”: “table”,
“source”: “/common/common.source”
},
{
“id”: “/mainPage/title.html”,
“type”: “html”,
“config”: {
“html”: “

Hello World!

”,
“$html”: {
“value”: “<div style="display: flex; flex-direction: column; padding-top: 24px">\n <h2 style="margin-left: -6px">Hello World from the Main\n\n <span style="margin-left: -4px">\n Seems like you are \n {{ apps.currentUser.firstName }} {{ apps.currentUser.lastName }},\n am I right?\n \n”
}
}
}
],
“global”: {
“theme”: {
“defaultTheme”: “dark”,
“isDarkModeSupported”: true
},
“variables”: [
{
“name”: “preselection”,
“type”: “object”,
“default”: [
“Jan”,
“Feb”
]
}
]
},
“version”: “0.0.1”
}

Johannes S: thanks a lot. i forgot do refresh properly. now its also working for me.
One last question maybe. I am not yet able to update the Value of the variable with another variable since i am not able to hand it over in the variable connotation (test_variable is a string):
variableupdate

Max T: Value should not be an array, but a string. If you want to set an array, use "type": "object" again.
I did not try a variable in that place, but it should be possible

Johannes S:
sadly i was not able to do this with a variable. As soon as you lose the array type of definition from global

“default”: [“whatever”]

the point of no return was reached :zwinkern: . Or i made other mistakes. BUt sadly the “object” type did not solve the issue