Skip to main content

Notifications

Copilot Studio - Calling Actions from Copilot S...
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)

Categories:
  • Egbert Profile Picture
    Egbert 33 on at
    Re: Can't update the value of an existing variable with the output of an Action

    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.

     

  • renatoromao Profile Picture
    renatoromao 6,819 on at
  • Chatbotdev Profile Picture
    Chatbotdev 7 on at
    Re: Can't update the value of an existing variable with the output of an Action

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

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,434

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,722

Leaderboard

Featured topics