Notifications
Announcements
Hi guys, I have a question. I'm trying to add a conditional node here with the following expectation: Whenever the last message/trigger message has the words "access" OR "license" then lead the user to a certain path on the workflow. This is the code I've been getting on preview:
Hi @Siziwe ,
I have the below example that you can reuse to meet your objective.
I actually use the LookUp formula in Power Fx.
I first setup a table variable with my list of keywords:
[ { Keyword: "Access" }, { Keyword: "License" },]
I then check if the user question contains the keyword or not (in lowercase):
!IsBlank( LookUp( Topic.Keywords, Lower(Keyword) in Lower(Topic.Question) ))
You can reproduce this by pasting the below YAML in a new topic:
kind: AdaptiveDialog beginDialog: kind: OnRecognizedIntent id: main intent: displayName: Keyword Condition triggerQueries: - Keyword condition actions: - kind: Question id: question_7REwVb interruptionPolicy: allowInterruption: true variable: init:Topic.Question prompt: What is your question? entity: StringPrebuiltEntity - kind: SetVariable id: setVariable_Xi46xv variable: Topic.Keywords value: |- =[ { Keyword: "Access" }, { Keyword: "License" }, ] - kind: SetVariable id: setVariable_5QF2kS variable: Topic.ContainsKeyword value: |- =!IsBlank( LookUp( Topic.Keywords, Lower(Keyword) in Lower(Topic.Question) ) ) - kind: ConditionGroup id: conditionGroup_ZXXmnq conditions: - id: conditionItem_DVxsJB condition: =Topic.ContainsKeyword = true actions: - kind: SendActivity id: sendActivity_dS0W20 activity: Your question contained a matching keyword. elseActions: - kind: SendActivity id: sendActivity_KB9kMN activity: Your question didn't contain a matching keyword.
Let me know if that helps
Hi @HenryJammes I'll test this out and get back with some feedback. Thank you so much.
Hi @HenryJammes,
The solutions worked. Thank you for your support. A question from my end - is there a resource guide you can direct me to learn more about these formulas or the LookUp function will help a lot?
There is the Power Fx formula language documentation or a few examples that apply to PVA here: https://learn.microsoft.com/en-us/power-virtual-agents/advanced-power-fx
Thanks @HenryJammes !
@Siziwe wrote:Thanks @HenryJammes !
No worries, keep them coming - we're looking at documenting as many examples and "how to" as possible to ease adoption.
Hello @HenryJammes , thanks for this. I am trying out something similar and this has helped me. Next thing I am looking for is something like if the user input has license in his input, it needs to call Flow1, if it has "Access" then flow 2 otherwise some default flow. Something like "I want my license renewed" - should trigger flow 1 identifying keyword as license. how can I do that?
Why not use trigger phrases/entities for that?
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 251 Super User 2025 Season 2
Romain The Low-Code... 201 Super User 2025 Season 2
S-Venkadesh 93 Moderator