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 / Can't update the value...
Copilot Studio
Unanswered

Can't update the value of an existing variable with the output of an Action

(3) ShareShare
ReportReport
Posted on by

Hi Team,
 
I've a dialogue where I run an Action to set the initial context with external data and then I have a loop, where its last step is rebuild the context to be used for the next cycle of the loop:

Untitled picture.png

Untitled picture2.png

The problem is that currently there is no way for us to update the Context variable from the beginning of the loop, with the value returned by the RebuilContent Action.

 

The current behavior is that any Action output is always created as a new variable, not allowing you to update an existing one!

Basically, the only option we've to update the value of an existing variable, is adding a question step, but that required the user to type the value, what is not useful when the value is returned by a Power Automation call (Action).

 

My request I would like to place, is that should be possible for us to choose to get a new variable automatically created (as is now) or be able manually map the output of the Action to an existing variable (similar to what we do with the inputs).

Thank you very much in advance,
Jose Alves (joseal)

I have the same question (0)
  • Chatbotdev Profile Picture
    7 on at

    Yes I am also facing the same issue, please provide a solution or an alternative approach for this.

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at
  • Egbert Profile Picture
    33 on at

    The only answer is to use an external store for the data item that needs to be updated. e.g. CDS or Excel

     

    Create an online Excel sheet or CDS which your PA Flow can access with two columns - guid and mydataitem

    If you have chosen to use Excel, make these two columns into a table. 

     

    At the first entry point to your bot, create a PA Flow which creates a guid (guid() is a function which is available from the Expression builder)

    Egbert_0-1603404923735.png

     

    then add a row to the table in your Excel sheet (or into CDS) with the guid and any initial value for mydataitem, or items. Return the guid to the PVA topic.

     

    In the PVA topic, make the guid returned from this PA Flow a global variable, so that any topic in your bot can access it.

    Egbert_1-1603405120238.png

     

    Create another PA Flow which accepts the guid as an input, and any other data you want to pass into it. This Flow should get the Excel/CDS row, using the guid as the key, meaning it will also find the value mydataitem for this user/bot session.

     

    You can manipulate the value of the data item(s)  as you see fit in this PA flow, using any of the actions available to PA. Store the value back to the same row in the Excel/CDS, again keyed by the guid, and return whatever values to your PVA topic.

     

    Call this Flow from anywhere in your bot, always passing in the bot.guid global variable.

     

    Of course, you can create as many different Flows as you like to access this temporary data store, as long as they use the global bot.guid to access the data for the current session.

     

    When convenient, if there is a common exit point from your bot, have another flow to clean up - deleting the row for the current guid. Or you could run a timed clean up flow every day.

     

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 250 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

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

#3
S-Venkadesh Profile Picture

S-Venkadesh 103 Moderator

Last 30 days Overall leaderboard