How to make a variable work inside another variable

I don’t know if the title describes the situation well.
But here is a simple example of what I mean:

<$vars
 Filter1="[!is[system]sort[title]]"
 Filter2="[tags[]sort[title]]"
>

<$button set="$:/state/test" setTo="1">1</$button>
<$button set="$:/state/test" setTo="2">2</$button>

<$set name="Suffix" value={{$:/state/test}}>
<$let CombinedFilter={{{ [[Filter]addsuffix<Suffix>] }}}>

<$list filter=<<CombinedFilter>>></$list>
</$let>
</$set>

</$vars>

Depending on witch button I clicked the output of the list is either “Filter1” or “Filter2”.

I wish the output was instead the value of the variables “Filter1” or “Filter2”, as defined in $vars:

 Filter1="[!is[system]sort[title]]"
 Filter2="[tags[]sort[title]]"

How can I do?

-Sam

Misunderstood the OP. Reply deleted.

you need

<$let CombinedFilter={{{ [[Filter]addsuffix<Suffix>getvariable[]] }}}>

1 Like

That’s great, thank you very much @buggyj!

-Sam