Unable to grab variable content in embedded SL file using JavaScript
Jul 23, 2019
Hi all. I have an external JS script that is using player = window.parent.GetPlayer(); to get the player and variable content from Storyline in order to generate a PDF. When I run this is SL directly, I have no problem seeing the variable content in the generated PDF file. However, if I embed the SL file as a Rise Storyline block, the PDF is generated without issue but no variable content is passed. I believe this has something to do with the fact that the SL file needs to reside in Articulate Review in order to be embedded and then some kind of frames in frames and security issues. I've tried various browsers and private modes to no avail. Does anyone have a suggestion on what might be preventing me from accessing variable content this way? Is there any way to directly embed an SL file into Rise without having to first host it in Review?
3 Replies
Thanks Matthew. I figured it out but also read Zolt's article that was quite interesting. Anyway, turns out I needed to refresh the slide where text entry items were located before executing the JS to generate the PDF. If a text entry field was empty and I typed something in the field then clicked a button to generate a PDF, the field remained empty in the PDF. However, if I reloaded the slide or went to another slide and then clicked the button, the variable information passes correctly to the PDF from Storyline, Review and Rise. : )
Thanks for sharing your discoveries, Stephanie! Hive mind in full effect. ☺️
Yes the text entry needs the slide to be reloaded for the pdf to grab the value. I normally add in a progress bar on another slide to also allow the web object time to load.
https://rise.articulate.com/share/9hMWTCm9ON0g5-gVjt3PBcs7cCQqWw_w
This discussion is closed. You can start a new discussion or contact Articulate Support.