I've created a chatbot in Cluelabs and embedded it in a Storyline file as a web object using the provided URL. It's working well. Eventually this will be part of a learning module accessed via Canvas. I'd like learners to be able to download or otherwise save a transcript of their chat so that they can turn it in as an assignment. I've tried integrating the chatbot with the PDF maker but it doesn't work. Is this something that's possible to do? Thanks!
Reply
Posted on 8/6/2025
Please type your reply.
@support
Hello,
The PDF Maker will take any variable, it doesn't really care whether the variable contains chat logs or anything else. So there's no reason why you can't concatenate all chats into a text variable and then export it into a PDF.
Reply
Posted on 8/6/2025
@amydunnwilliams
Is there a built-in variable or method to retrieve the full conversation text (e.g., {{chatLog}} or window.chatbot.getTranscript()) so that I can pass it to Storyline or a PDF widget automatically?
Reply
Posted on 8/6/2025
@support
You can use online resources on JavaScript to learn more about coding in JS, but, in short, to concatenate strings in JavaScript, you just use a plus operator ("+" - a plus sign).
So, for example, if you want to store your log in a variable log and you use the standard variables clabsAnswersUserMessage and lclabsAnswersResponseMessage for the user and the chatbot text, adding two triggers (for when either the user or the chatbot say something - e.g. "when the variable changes") should do it.
let player = GetPlayer(); let message = player.GetVar('clabsAnswersUserMessage'); let log = player.GetVar('log'); log = log + 'USER: ' + message + "\n\n"; player.SetVar('log', log);
and
let player = GetPlayer(); let message = player.GetVar('clabsAnswersResponseMessage'); let log = player.GetVar('log'); log = log + 'CHATBOT: ' + message + "\n\n"; player.SetVar('log', log);
So, in the end, you will have the full chain in the Storyline variable log which you can then pass to the PDF.