web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Copilot Agent embedded...
Copilot Studio
Unanswered

Copilot Agent embedded in D365 Case (incident) form is not updating context on record change

(1) ShareShare
ReportReport
Posted on by 4
Hello community,
 
We have embedded a Copilot Studio Agent into an iframe on a D365 Case form. We have passed the recordid to the agent for a contextual conversation experience. The issue is that, no matter what we try, when switching records/cases the agent conversation does not update to the new record context and remains stuck with the initial accessed record/case. The only scenario when the Copilot Agent updates context to the current record is when the record is opened in a new browser tab. We have tried multiple ways of resetting the iframe with JS scripting or using end conversation agent topic, but nothing seems to work.
In the browser dev console the recordid and conversationid are updating dinamically, but somehow the initial conversation is trailing along and the conversation with the agent is stuck on the first record.
 
Does anyone have any ideas on how to tackle this?
 
Thank you!
 
 
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
     
    My guess here is that you are not Ending the previous conversation so its not going to reset.
     
    Either add a way (call it via javascript) to end all current sessions (or at least the current one), for that instance of the Agent, then restart with the new information, as that is the only reason I can think of for it to be stuck, and yes this will happen also when you think about sessions etc for even the current user, how it keeps the history and its like. uggg i just want it "cleared", well you need to end the current session/conversation.
     
    Please let me know if this helps or if you have further questions.
     
    If this resolves your issue please Mark as such and Maybe a like.

    Thanks!!
  • assdaer Profile Picture
    4 on at
    The issue we are having is that we have no way of refreshing the agent's session storage. We have tried to use JS to refresh sessions (but can only target the web app - in this case D365) to no success as we didn't find an actual way to give the command to the agent to reset it's session storage.
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
     
    Let's take this another way, as I cannot see the flow etc so there is limited things I can do or suggest.
     
    Please walk me through step by step how you added the Bot (Yes I know its an iframe), how are you passing the ID to the bot initially?
    How exactly are you opening the new case? literally step by step
    When you come back into the Form, is the iframe Auto-refreshed via Javascript?
    When your bot first loads, you can always tell it to stop existing conversations and then continue on.
     
    Its too much to go back and forth on an agent that isn't shared or details. I get the error, but need to have what you built shown and explained ho you are making it load even the initial one. then be able to walk through those steps to tell you what I recommend.
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 265 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 240 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 101 Moderator

Last 30 days Overall leaderboard