Hi,
I have an issue using global variables in Copilot Studio.
Background
I'm writing a copilot studio bot, which uses an HTTP action to send requests to an Azure OpenAI model. The connection works fine, but since I use HTTP every request is unique, meaning the previous context gets lost. I'm using a global variable to save previous requests and responses, and send them as context in the HTTP request.
Setup
1. I initialize the global variable Conversation in the "Conversation Start" topic. The global variable is just an empty table. It is supposed to save the queries and responses for the whole conversation.
2. At the beginning of my main topic, I set a global variable RequestBody. This is the variable defining the request sent with the HTTP request. It takes the current user query and adds the content of the Conversation variable. So the request includes the current query and the conversation which happended before.
3. I send the request via an HTTP action with the RequestBody variable providing the content.
4. After the request returned successfully, I add the user query and response to the Conversation variable.
Issue
The problem is that the Conversation variable gets correctly set on the first query and I get the correct response. But when I send a second query, I get an error, because the content of the Converation variable has partly been set to null.
After the first query, the RequestBody was correctly set, containing only the user query.
The Conversation variable is also correctly set: It contains the user query and the response.
If I write an additional query, the RequestBody variable is not set correctly. Instead of adding the content of the Conversation variable to the request, it adds the structure, but the content and role are null.
I find this strange behavour. I would expect to either return null for the whole Conversation variable or set it correctly. But it provides the structure correctly, only the values of the fields are set to null.
Does anybody have an idea what the issue may be?
Regards