Skip to main content

Notifications

Copilot Studio - Topic Creation & Management
Unanswered

Dynamic topic redirection

(0) ShareShare
ReportReport
Posted on by 2

Hi there,

 

My team has recently started using Microsoft PVA to create a chatbot. The chatbot is quite complicated and results in very large topics, both vertically and horizontally. Having dynamic topic redirection functionality will be a massive help in solving this. Instead of having multiple topic redirects based on a conditional statement, we could use a single topic redirect which redirects to a topic specified by a variable value.

 

I have tried to get this to work using the code editor. The original topic is shown below:

 

 

kind: AdaptiveDialog
beginDialog:
 kind: OnRecognizedIntent
 id: main
 intent:
 displayName: temp_main
 triggerQueries:
 - test dynamic redirect

 actions:
 - kind: SetVariable
 id: setVariable_DO3Gz4
 variable: Topic.TopicName
 value: temp_1

 - kind: BeginDialog
 id: zyOpb8
 dialog: cr585_bOServiceBot.topic.temp_1

 

 

Now to dynamically redirect to the topic specified by the variable "TopicName", I tried to modify the redirect block as follows:

 

 

 - kind: BeginDialog
 id: zyOpb8
 dialog: cr585_bOServiceBot.topic.${Topic.TopicName}

 

 

However, this (and other similar attempts) causes an error when saving and when testing the chatbot. Is there any work-around for this? Or is there a plan to introduce dynamic topic redirect functionality to PVA?

 

Any help or information on this would be greatly appreciated.

 

Thanks!

cvallabh 

  • DanNewton Profile Picture
    DanNewton 29 on at
    Dynamic topic redirection
     
    Do you happen to know if this workaround has been removed or is no longer functional?
     
    As of December 2024, I’m consistently running into errors with topic validation whenever I try to apply this workaround, which is now blocking publishing entirely. Despite testing various syntax formats, the issue remains unresolved. Our requirement is to use a Power Automate Action and/or HTTP call to dynamically determine the next topic for the user, as using a condition isn't feasible given the approximately 40 possible outcomes.
     
    Would be great to hear your thoughts.
     
     
  • wswitzer Profile Picture
    wswitzer 74 on at
    Re: Dynamic topic redirection

    Thanks @HenryJammes . I finally just set this up right now and it works perfectly for my usecase. I'm also wondering if it's possible to dynamically change a variable in this way.

     

    This code doesn't work

     - kind: SetVariable
     id: setVariable_98I9xi
     variable: |-
     =Switch(
     Topic.redirectTo,
     "upset", Global.Upset,
     "emotion", Global.Emotion, 
     "crc5c_forgivenessAiDemo_WyZVYd.topic.Fallback"
     )
     value: =Topic.userInput
  • HenryJammes Profile Picture
    HenryJammes on at
    Re: Dynamic topic redirection

    Actually @wswitzer@cvallabh, I've learned that dynamic redirects are already possible, but you have to use the code editor view for this. We're looking to see if this can be added to the UX as well.

     

    Here's an example where I go to a different topic based on a variable value:

     

    HenryJammes_0-1706003479209.png

     

    In the code editor, in the dialog property, can use a Power Fx formula to define the topic to trigger:

    HenryJammes_1-1706003673684.png

     

    kind: AdaptiveDialog
    beginDialog:
     kind: OnRecognizedIntent
     id: main
     intent:
     triggerQueries:
     - Dynamic redirects
    
     actions:
     - kind: SetVariable
     id: setVariable_7bgfoP
     variable: Topic.MyVariable
     value: =RandBetween(0,4)
    
     - kind: BeginDialog
     id: A4lDAn
     dialog: |-
     =Switch(
     Topic.MyVariable,
     1, "cat_MyBot.topic.Lesson1",
     2, "cat_MyBot.topic.Lesson2",
     3, "cat_MyBot.topic.Lesson3",
     "cat_MyBot.topic.Fallback"
     )

     

     

     

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: Dynamic topic redirection

    @wswitzer - I saw the feature request, but it doesn't have any detail on the customer who would benefit from it or the business impact, is there any chance you can add more color to this?  Not debating the usefulness of this, but feature requests are often prioritized based on business impact and number and size of the requesting customers.

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: Dynamic topic redirection

    No, but let me check again. 

  • wswitzer Profile Picture
    wswitzer 74 on at
    Re: Dynamic topic redirection

    Did this ever get looked at/implemented in any way?

  • cvallabh Profile Picture
    cvallabh 2 on at
    Re: Dynamic topic redirection

    Thanks @HenryJammes , I have submitted the idea!

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: Dynamic topic redirection

    Hi @cvallabh 

     

    I love this idea, and this is also something I had suggested internally.

    To help get this prioritized, can you please submit a feature request here?

    https://aka.ms/PVAFeatureRequest

     

    Cc. @GaryPrettyMsft 

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,526

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard

Featured topics