Announcements
Hi, I'm new to Power Virtual Agents, going through MS learning path, and the unit on Inputs Variables Conditions led me to this:
Seems like a huge diagram, and a lot of items to create and configure, for only 4 choices. Just wondering if there's a way to set up multiple conditions in one node, like:
Condition
{x} VarCountry (text)
is equal to
Canada, France, Spain, USA
Message
Lidia Holloway, Miriam Graham, Christie Cline, Lynne Robbins
Or some other way to have it select from multiple Message values based the input Variable value?
Hi again @Pstork1 , firstly thank you thank you thank you! Took me a while to get back to this, and initially was a bit stymied because I'd been working in PVA installed in Teams, which did not have a Node option for Set Variable (here are the Teams' PVA node options):
So I signed up for free trial in the web portal, and now seeing the Set Variable option, and To Value with Formula tab... AWESOME!
So your Switch workaround would absolutely work if the multiple choice options could be grouped into a smaller number of choices, AND if separate conditional actions necessitated separate Nodes.
In my case, I just needed to output a message contents based on the choice selection. Thanks to your suggestion, I was able to accomplish multiple conditional messages without using Condition Nodes at all - I Switched the choice Var1 with text strings into Var2
Switch(Text(Topic.Var1),"France","france contact","Spain","spain contact","USA","usa contact","None")
And output that in the Message
The contact for {x}Var1 is {x}Var2.
Thanks again!
YOu can add it to a Set Variable action using the unified Canvas.
Hi, thanks, I'd like to try that, though I don't know how I could put that in a step; as I said, very new to PVA.
I had one other thought for a potential workaround. You could use a PowerFX Switch() function to transform the original choice into grouped options in a new variable and then do the condition based on the value of the grouping. For example if your choices were New York, Chicago, London, or Paris you could save a variable of NA if its New York or Chicago and EU if its London or Paris. Then do the condition based on either NA or EU
Switch(Text(Topic.Var3),"New York","NA","Chicago","NA","London","EU","Paris","EU","None")
Unfortunately, at this point PVA doesn't support a contains condition so there is no way to group multiple conditions.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.