cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoseAl
Microsoft
Microsoft

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

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)

3 REPLIES 3
Chatbotdev
Regular Visitor

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

Hi @Chatbotdev  / @JoseAl ,

 

Unfortunately, it's not available yet.

But you can vote in these ideas here: https://powerusers.microsoft.com/t5/Power-Virtual-Agents-Ideas/Allow-Flow-response-messages-to-overw...

https://powerusers.microsoft.com/t5/Power-Virtual-Agents-Ideas/Change-the-value-of-a-variable-withou...


Did I answer your question? Mark my post as a solution!
Thanks!

Renato Romão,

Connect with me here 😉

Power Virtual Agents course (+2.650 students) : English | Português

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.

 

Helpful resources

Announcements
March Update

Welcome to the User Group Private Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,258)