Mapping of variable value in HTML element

Hi App builders,

I have a unqiue integer value stored in a variable which I can access via {{filter.xyz}} (with xyz als my variable). I do not want to display this integer in my HTML elment rather a mapping of this value (e.g. if value equals 0 → display “Red”, if value equals 1 → display green).

For example within a datasource there is a key which cann be used to create such a mapping. For the HTML there does not exists something like this but maybe you know a nice workaround.

Thanks, Christoph :slight_smile:

Dear Christoph,

maybe a hidden filter element might be helping here:

  1. Unique integer value is selected via variable
  2. There is a hidden filter element which data source has the columns [integer_value | value_mapping]
  3. Via source options filter the hidden filter data source for the variable integer value
  4. With filter.hidden_filter.value_mapping.values you can now display the STRING mapped to the integer value

I hope, I understood your issue correctly and this helps!
Magy

1 Like