Thank you very much tpartner.
I managed to get it to work. However, I decided to do some stuff different then I described it before, I will try to explain my current approach so that if people have a similar problem can profit.
Im using Microsoft Botframework and integrate it into a Limsurveyquestion using the JavaScript Ui component from BotFramework-WebChat (Github:
github.com/microsoft/BotFramework-WebChat
).
From the Botframework I can send events, that I can receive using JavaScript (example code can be found here:
github.com/microsoft/BotFramework-WebCha...oming-activity-event
).
The data of the events I can then use to prefill a question that is hidden using the CSS class "hidden". The code that i use for this look like this:
window.addEventListener('webchatincomingactivity', ({ data }) => {
console.log(`Received an activity of type "${data.type}":`);
console.log(data);
if(data.type === "event"){
$("#answer8944X7X28").val(data.value).trigger('keyup');
}
});