Title is pretty explanatory, need to access the session variables (defined in OS) using the JS defined in a web block, is it possible to do?
Thanks in advance!
Hi Fábio,
There is no direct way to achieve the mentioned objective but you can try the below steps:
Steps to Follow:
1) Within the WebBlock define an Input widget of which the variable property is mapped with Session Variable and also define the respective Input widget Style Classes with a pre-defined hidden CSS class as shown below..
2) Introduce an Expression widget with Escape Content property set to No
3) Add the below JS code inside the expression widget
"<script> var ele = document.getElementById('" + HiddentInpt.Id + "'); var sessionValue = ele.value; console.log(sessionValue); </script>"
Hope this helps you!
Regards,
Benjith Sam
I think you can try using "RunJavaScript" action under "HTTPRequestHandler".
Sughosh