Skip to main content

Hello there,

I am trying to embed a view by variable value. Using the explanation on (https://docs.celonis.com/en/views-variables.html) this is the current state.

 

Here I have created the view-variable 'embed_variable' and two separate views with the keys 'embed-test-source' and 'embed-test-source-alternate'. If the value of 'embed_variable' is '1' I want to embed the 'embed-test-source' view just how I want to embed 'embed-test-source-alternate' when the value of the variabe is '2'.

 

I tried to follow the example from Celonis metioned above, so I'm not too sure about what the errors mean. Has anyone experience using this method and can tell me where I went wrong? I would be very grateful.

 

Code and Errors

I have nested variables for drop down selection in views. But never for embedded views. Tried the logic for simple key and it does work. Are you able to do this using a simple variable. i.e..${varEmbededViewName}, the multiple split of variable may be contributing to the error.


Hello there,

yes it would work with a simple variable, therefore i could use a workaround. In this case I need the dictionary to translate the value into view-key because the variable itself in my example cant take on the actual view-name. The Celonis Documentary i linked says this is possible but if not I'll just use the workaround. Thanks for your help!

Celonis Documentation


Send feedback response using "Was this helpful?" to the documentation, sometimes the code is outdated and Celonis correct after a few weeks. Not great but will get you your answer either way.


Send feedback response using "Was this helpful?" to the documentation, sometimes the code is outdated and Celonis correct after a few weeks. Not great but will get you your answer either way.

Tobias - also let me know if they do correct as would also have a use for it.


Hi both, just to add here, I finally managed to crack the JS syntax after multiple days of trying. I am using the ${CONDITION?THEN:ELSE} logic they posted in the “Views Variables” page of the documentation.

The mistake I kept making is that I was using the ID of my KPI when declaring the condition instead of the simple name. So my code basically is

type: view

settings:

key: ${(variable name == ‘KPI name’?’view’s name’:’fall back view’s name’)}

 

Hope this would help!


Hi both, just to add here, I finally managed to crack the JS syntax after multiple days of trying. I am using the ${CONDITION?THEN:ELSE} logic they posted in the “Views Variables” page of the documentation.

The mistake I kept making is that I was using the ID of my KPI when declaring the condition instead of the simple name. So my code basically is

type: view

settings:

key: ${(variable name == ‘KPI name’?’view’s name’:’fall back view’s name’)}

 

Hope this would help!

Hi Lukas,

thanks for sharing. This works very well!


Reply