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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ChatBot Refresh Issue ...
Power Apps
Suggested Answer

ChatBot Refresh Issue During Screen Navigation in Power Apps

(0) ShareShare
ReportReport
Posted on by

In our PowerApps project, we have multiple screens, each featuring a Copilot icon at the top. Clicking this icon opens an interface where users can interact with the chatbot. However, if a user navigates to a different screen while using the chatbot, the chatbot gets refreshed, and all previous chat history is lost. The chatbot resets, forcing the user to start over from the beginning.

 

What modifications can we implement to ensure that the chatbot continues functioning without refreshing or resetting to its initial state when the user navigates to another screen?

Screenshot 2024-11-21 140814.png
Categories:
I have the same question (0)
  • Suggested answer
    SwatiSTW Profile Picture
    809 Super User 2026 Season 1 on at
    1. Create a global variable called gblChatHistory to store the chatbot's conversation history.

    2. Update the chatbot's functionality to append new messages to gblChatHistory instead of local variables.

    3. Use a collection called colChatHistory to store structured data for messages, including user input and bot responses.

    4. Ensure that each new message (both user and bot) is added to colChatHistory using the Collect function.

    5. Add the chatbot interface as a reusable component so it can be embedded on multiple screens.

    6. Pass colChatHistory as an input property to the chatbot component to make it consistent across screens.

    7. Use the OnVisible property of each screen to reload the conversation history from gblChatHistory into colChatHistory.

    8. Use the OnHidden property of each screen to save colChatHistory back into gblChatHistory to ensure continuity.

    9. Set a global variable like gblShowChatbot to manage the chatbot's visibility, ensuring it remains open even if users switch screens.

    10. Test the implementation by navigating across screens and verifying that the chat history and chatbot state are retained.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard