Passing simple or complex properties to custom elements from the adaptive card using SDK #6902
-
Hi, I'm looking for a way to pass "context" properties to custom elements of an Adaptive Card. Basically, each custom element needs values that cannot be configured on the control itself, but which come from the context in which the Card is rendered. I'm talking about the JavaScript implementation of the SDK. I tried to use the "setCustomProperty ('x', 1)" method on the Card object and then inside the class, specifically in the "internalRender" method I tried to retrieve the value like this:
In none of these ways can I get the value of "x". @matthidinger can you help me? :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found a way... It's the best option avaible? |
Beta Was this translation helpful? Give feedback.
I found a way...
I used this code when I set the host config for AC:
hostConfig.hostCapabilities.setCustomProperty("__test", 123);
and this one into the custom element or action:
this.hostConfig.hostCapabilities.getCustomProperty("__test");
In this way it's working!
It's the best option avaible?
It's correct to use this way to passing "context" props to custom elements/actions?