Hello,
I have a JS function, e.g.
function GetId() {
Id = ...
return Id; }
How can I call this JS function and show the Id in the screen?
I have tried putting it in the module Scripts and also tried directly putting it into a JS element in a screen action, but I am struggling a bit. Thank you!
hi,
You can take a look at this:
https://success.outsystems.com/documentation/11/extensibility_and_integration/javascript/extend_your_mobile_and_reactive_apps_using_javascript/
Hope this can help.
Best regards,
Ricardo Pereira
Hi @Cute Bear, I am adding an OML with a working example. I have provided examples for both screen JS node and global JS.
Also do read the documentation suggested by @Ricardo Pereira.
ThanksGitansh Anand
@Cute Bear
You can easily call this JS function and show the Id in the screen.
in js widget you have to create one output variable and call the function GetId() and assign to that output variable
e.g.
Id = 7
return Id;
}
$parameters.Id = GetId();
Use Id output variable in your screen
I have attached sample oml check that.
Thanks Regards,
Rizwan
05/11/2023 hi..I don't know if your answer worked for Cute Bear, but it worked perfectly for me.. Thanks for sharing :)
Sorry my English :|
Hi @Cute Bear
You can do it like this, in your module interface tab create a new script
Then write code like this -
and call the functions like this -
I hope it'll help you to solve your issue,
Thanks
Deep