Custom Functions for AdaptiveCards in JavaScript #6059
Replies: 2 comments 2 replies
-
@gabrielpassmann I'm too trying to create a custom function in Javascript for Adaptive cards. I have created the function similarly, but when I try to use it my UI schema template, I get 'Unknown function error'. Do you know how can I use my custom function in my template schema ? |
Beta Was this translation helpful? Give feedback.
-
We were also running into issues getting custom functions to work with the Javascript SDK. I noticed it is currently not implemented in the Only built-in functions are supported out of the box. We also noticed that there was an actual PR for supporting this: #6132 which is closed but never merged.. For now we worked around it by monkey patching the
in this case Still hoping that this will actually be supported at some point, but seeing there has been no activity on this for a long time this has to do for now. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
I've been trying to create a custom function in JavaScript for AdaptiveCards. See following code:
Simply put, i give the function a name, pass a callback function in which I simply wanna translate a key and return its translated value. The translation on it's own works fine. But when trying to invoke this custom function, it says that "i18n" is an unknown function. I invoked this function right before the templateData gets initialized.
Funny thing is, when I search for this custom function, it is listed up along all other built-in functions.
I know there is a tutorial on how to implement this on C# but not in JavaScript. Did i do it the right way or do I need to change something?
Beta Was this translation helpful? Give feedback.
All reactions