Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FactSet is not working $data from set property #8798

Closed
jsia9 opened this issue Nov 17, 2021 · 8 comments
Closed

FactSet is not working $data from set property #8798

jsia9 opened this issue Nov 17, 2021 · 8 comments
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete. Type: Bug Something isn't working

Comments

@jsia9
Copy link

jsia9 commented Nov 17, 2021

Describe the bug

i ve been trying for a few hours to get this working.
when using SetProperty to set the array used by FactSets in Adaptive Cards, the key and value entries are not taken into account.

Version

Version: 1.4.1
Electron: 8.2.4
Chrome: 80.0.3987.165
NodeJS: 12.13.0
V8: 8.0.426.27-electron.0

as I am using a few custom behaviors in nodejs.

OS

macOS

To Reproduce

my situation is identical to this one , the only difference is that i get 'a scope of 'key' wasnt found'
set property dialog.carddataproperties with the array:

[ { "key": "Assigned to", "value": "Matt Hidinger" }, { "key": "Due date", "value": "Not set" } ]

{ "type": "FactSet", "facts": [ { "$data": "${dialog.carddataproperties}", "title": "${key}:", "value": "${value}" } ] }

The error in Bot Framework Emulator is consistently the same.

valueType:"https://www.botframework.com/schemas/error"
value:"DialogContextError: Error: Error: DialogStateManager.getValue: a scope of 'key' wasn't found. [SendActivity_mpITBn] Error occurred when evaluating 'Attachments=${json(fromFile('.\\adaptivecard-Broken.json'))}'. [__temp__3c036cd87b1042cbbdc81b93d3c81283] Error occurred when evaluating '-```${SendActivity_mpITBn()}```'., Error: Error: DialogStateManager.getValue: a scope of 'key' wasn't found. [SendActivity_mpITBn] Error occurred when evaluating 'Attachments=${json(fromFile('.\\adaptivecard-Broken.json'))}'. [__temp__202e876c26e340e1b1bf93d7ace0e385] Error occurred when evaluating '-```${SendActivity_mpITBn()}```'."

it seems that I am not the only one to have this issue but never solved here

Even more confusing is that , I tried to replicate it the exact sequence in the official designer
https://adaptivecards.io/designer/ and it works.

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "size": "Medium",
            "weight": "Bolder",
            "text": "${dialog.carddata.title}",
            "wrap": true
        },
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "Image",
                            "style": "Person",
                            "url": "${dialog.carddata.creator.profileImage}",
                            "size": "Small"
                        }
                    ],
                    "width": "auto"
                },
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "TextBlock",
                            "weight": "Bolder",
                            "text": "${dialog.carddata.creator.name}",
                            "wrap": true
                        },
                        {
                            "type": "TextBlock",
                            "spacing": "None",
                            "text": "Created {{DATE(${string(dialog.carddata.createdUtc)}, SHORT)}}",
                            "isSubtle": true,
                            "wrap": true
                        }
                    ],
                    "width": "stretch"
                }
            ]
        },
        {
            "type": "TextBlock",
            "text": "${dialog.carddata.description}",
            "wrap": true
        },
        {
            "type": "FactSet",
            "facts": [
                {
                    "$data": "${dialog.carddata.properties}",
                    "title": "${key}:",
                    "value": "${value}"
                }
            ]
        }
    ],
    "actions": [
        {
            "type": "Action.OpenUrl",
            "title": "View Standards",
            "url": "${dialog.carddata.viewUrl}"
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.2"
}

Data:

{"dialog":{ "carddata" :
{
  "title": "my title",
  "description": "Ok, details and description",
  "creator": {
    "name": "Debugging request",
    "profileImage": "https://www.example.com/growth_96x96.svg"
  },
  "createdUtc": "2017-02-14T06:08:39Z",
  "viewUrl": "https://example.com/wiki",
  "properties": [
    {
      "key": "1.",
      "value": "my first value"
    },
    {
      "key": "2",
      "value": "my second value: this is 2"
    },
    {
      "key": "Assigned to",
      "value": "Matt Hidinger"
    },
    {
      "key": "Due date",
      "value": "Not set"
    }
  ]
}
}}```

is there a difference in the type of a dialog property?
## Expected behavior

I should have a generated adaptive card.
## Screenshots
https://stackoverflow.com/questions/67673769/botframework-composer-use-factset-to-show-multiple-data

## Additional context

<!-- Add any other context about the problem here. -->
@jsia9 jsia9 added Needs-triage A new issue that require triage Type: Bug Something isn't working labels Nov 17, 2021
@stevkan stevkan added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Required for internal Azure reporting. Do not delete. labels Nov 17, 2021
@johnataylor johnataylor removed the Needs-triage A new issue that require triage label Nov 18, 2021
@dmvtech
Copy link
Collaborator

dmvtech commented Nov 19, 2021

Hi @jamalsia I can reproduce and see the same. I'm not sure yet on how to make this work, but obviously some colliding between adaptive expressions and adaptive card templating.

I can (not surprisingly) get the card to work if I avoid the $data templating and just hard coding something like:

    "body": [
        {
            "type": "FactSet",
            "facts": [
                {
                    "title": "mytitle",
                    "value": "myvalue"
                }
            ]
        }
    ],

@boydc2014 Can you take a look at this and see if you have any thoughts/ideas/suggestions?

@dmvtech dmvtech added the customer-replied-to Required for internal reporting. Do not delete. label Nov 19, 2021
@boydc2014
Copy link
Contributor

@jsia9 Is that possible for you to avoid $ in your data's key?

$ in Composer represents a shorthand for a special memory path (dialog.foo) https://docs.microsoft.com/en-us/azure/bot-service/adaptive-dialog/adaptive-dialog-prebuilt-memory-states?view=azure-bot-service-4.0#dialog-scope.

I think for that reason, it complains as not found.

@dmvtech
Copy link
Collaborator

dmvtech commented Nov 24, 2021

Hi @boydc2014 Adaptive Card templating uses the $. Please see more info here.

Do we need to make changes to resolve this or will/would this be a limitation of using Adaptive Cards within Adaptive Expressions?

@benbrown benbrown assigned boydc2014 and unassigned dmvtech Dec 8, 2021
@munozemilio
Copy link
Member

Hello @boydc2014 ...is there any update on this?

@carlosscastro
Copy link
Member

@boydc2014 could you please follow up on this issue? Do we have updates on this front?

@msomanathan
Copy link

@boydc2014 Could you please provide updates to this issue? Thanks!

@mrivera-ms
Copy link

@boydc2014, do you have any updates on this?

@dmvtech
Copy link
Collaborator

dmvtech commented Mar 1, 2022

@jsia9 It looks like adaptive card templating is not implemented in the SDK.
microsoft/botframework-sdk#6477

Closing this for tracking on that issue/feature request.

Thanks for bringing this to our attention and for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete. Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants