question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to begin a dialog with a variable value as the dialog name

See original GitHub issue

I setup the Event activity with the dialog name as the Activity Value, and then have an expression of =turn.activity.value in Dialog name field, but does not seem working as it results in a Null Ref exception in the BotController.cs

What would be the correct way to dynamically begin a dialog with the given name through a variable?

image image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
EricDahlvangcommented, Dec 7, 2021

Hello @dawwa and thank you for engaging with the Composer project. Supporting the “dialogs” array in the Composer ui would be a new feature request. We’ll take this issue as a feature request and add it to the backlog for prioritization. We do not have an ETA at this time for when this feature will be available.

1reaction
anishprasad01commented, Dec 7, 2021

@dawwa

It seems to be that there is an issue with how Composer deals with DialogSets internally. The NullReferenceException you’re getting is likely because the bot cannot find the dialog in question, and not because of any issue with the user’s input.

However, there is a workaround. This issue thread outlines a workaround that involves creating a dummy event that you never call and invoking all of your dialogs in it. Then, invoking the dialog with the input format =turn.activity.value in the Dialog name field of your original event should result in the behavior you’re looking for. Make sure to do this in the root dialog (where your event is). If you do it in a child dialog, it may not work.

Alternatively, you can go into the code view of your root dialog and add an array of dialogs to achieve the same effect without the need for a dummy event (see image below).

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to show variable's value in Dialog Name (Einstein Bot)
I have a menu, with two options, and the first show a text with a variable, but {!Product} don't works, there is a...
Read more >
Creating the Dialog - IBM
In the Dialog Properties pane: Enter the value Rboxplot_Demo for the Dialog Name. Enter Rboxplot Demo for the Title. Click the ellipsis (....
Read more >
Passing Variables in jQuery to Change a Dialog Title
Please change the textbox id with suitable name. try like this. var titleValue=$("#input").val(); $( "#dialog_box" ).dialog({ title: ...
Read more >
How to show variable's value in Dialog Name (Einstein Bot)
I have a menu, with two options, and the first show a text with a variable, but {!Product} don't works, there is a...
Read more >
How to Make Dialogs (The Java™ Tutorials > Creating a GUI ...
JOptionPane provides support for laying out standard dialogs, providing icons, specifying the dialog title and text, and customizing the button text.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found