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.

[Adaptive] `getProperty` prebuilt function or dynamic index does not work

See original GitHub issue

@boydc2014 @luhan2017

Our Todo bot sample uses this approach and this does not work in master.

The goal is that we need this -

user.lists = {
    "todo": [
        "one", 
        "two"
    ],
    "shopping": [],
    "generic": []
}

The following C# code does not work -

var rootDialog = new AdaptiveDialog(nameof(AdaptiveDialog))
{
    Generator = new TemplateEngineLanguageGenerator(),
    Triggers = new List<OnCondition>()
    {
        new OnConversationUpdateActivity()
        {
            Actions = WelcomeUserAction()
        },
        new OnIntent() {
            Intent = "GetUserProfile",
            Actions = new List<Dialog>() {
                new InitProperty() {
                    Property = "user.lists",
                    Type = "object"
                },
                new SetProperty() {
                    Property = "$listName",
                    Value = "'todo'"
                },
                new InitProperty() {
                    // Alternatively getProperty(user.lists, $listName) does not work either
                    Property = "user.lists[$listName]",
                    Type = "array"
                },
                new EditArray() {
                    // Alternatively getProperty(user.lists, $listName) does not work either
                    ItemsProperty = "user.lists[$listName]",
                    Value = "'one'",
                    ChangeType = EditArray.ArrayChangeType.Push
                },
                new SendActivity() {
                    Activity = new ActivityTemplate("I have '{join(user.lists[$listName], ', ')}'")
                }
            }
        }
    }
};

Expected:

    I have 'one'

Actual:

      Exception caught : Error occurs when evaluating expression $join(user.lists[$listName], ', '): user.lists[$listName] evaluates to  which is not a list.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
luhan2017commented, Oct 23, 2019

I verified in Tom’s branch, it is working now.

2reactions
tomlmcommented, Oct 23, 2019

#2818 PR is out

Read more comments on GitHub >

github_iconTop Results From Across the Web

4.6 Milestone
[Adaptive] getProperty prebuilt function or dynamic index does not work 4.6 ... [Adaptive] Validation on inputs do not work correctly when the input's ......
Read more >
Retrieving a property of a JSON object by index?
1 You may want to use the hasOwnProperty() method to ensure that the properties belong to your object and are not inherited from...
Read more >
Add System Properties
This page provides a canonical method for adding or defining system properties in Android, with guidelines for refactoring existing system properties.
Read more >
Developing Dynamically Reconfigurable Real-Time ...
In order to address the incompatibility of using the OSGi Framework to develop and deploy dynamically reconfigurable real-time applications, the Real-. Time ...
Read more >
Configuration | Apache Flink
Configuration # All configuration is done in conf/flink-conf.yaml, which is expected to be a flat collection of YAML key value pairs with format...
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