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 / Copilot Studio / How to add/append to a...
Copilot Studio
Suggested Answer

How to add/append to a conversation record?

(0) ShareShare
ReportReport
Posted on by

We are aiming to keep a record of the bots conversation with the user so that copilot can search the data for context based on the users previous input. How can we append or "add" to the record (which is essentially a "table"/array of transcripts that make up the entire conversation record. 

It seems like there should be an easy way to do his without using power automate flows. If this is the only way, how do we go about doing this?

Categories:
I have the same question (0)
  • Suggested answer
    -jake- Profile Picture
    38 on at
    Struggled with with appending message objects to a conversation array in late 2023. What ended up working was storing the conversation history table/array as a global string variable. 
     
    Our responses were coming from a custom backend (via logic app). Each time that topic got called, an action would append the input/output object like this:
     
     
    Here is the value formula:
    Global.messageHistory &
    "{""role"": ""human"", ""content"": """ & Substitute(System.Activity.Text,"""","\""") & """}," &
    "{""role"": ""ai"", ""content"": """ & Substitute(Global.responseBodyLogicApp.responseMessage,"""","\""") & """},"
     
    It was a major pain, and this workaround is ugly. But it works and has been reliable.
     
    Note: you may not need the Substitute function ... I think that was something unique to our response body
     
    Note 2: the conversation array (as a string) will have a trailing comma after the last object, like: {obj1},{obj2},{obj3}, 
    You will need to trim that, and place the rest into brackets [ ] before converting it to a proper table data type

     
     
  • -jake- Profile Picture
    38 on at
    I think you can probably ignore what I typed up earlier. I forgot about the "update items in a list" variable action. You might need to add it from code editor but it will make this 100x simpler to achieve than what I was describing.
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Copilot Studio

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 240 Super User 2026 Season 1

#2
Valantis Profile Picture

Valantis 226

#3
Arild Aarnes Profile Picture

Arild Aarnes 73 Super User 2026 Season 1

Last 30 days Overall leaderboard