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

AdaptiveCards data property does not handle null values properly #1343

Closed
davhdavh opened this issue May 25, 2022 · 2 comments
Closed

AdaptiveCards data property does not handle null values properly #1343

davhdavh opened this issue May 25, 2022 · 2 comments
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository.

Comments

@davhdavh
Copy link

Describe the bug

image
if dialog.config.Site is null, the renderer behaves as if the given object has no .Site at all and just outputs "${$root.Site}".

Also, This defeats the purpose of coalesce function which REQUIRES the value to be null (to use 2nd arg), not just an empty string.

Version

1.3

To Reproduce

  1. set a property in an object to null, e.g. dialog.Site = null
  2. use object in data, i.e. =dialog
    3a. use ${$root.Site} somewhere in adaptive card
    3b. use ${coalesce($root.Site, "default")}

Expected behavior

3a. rendered text is "", or "null", or "(null)". NOT "${$root.Site}"
3b. rendered text is "default"

@davhdavh davhdavh added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels May 25, 2022
@dmvtech
Copy link

dmvtech commented May 26, 2022

Hello @davhdavh

I'm confused on what $root is. Is that supposed to be a value in the template? i.e. are you using Adaptive Card templating? If so, that is currently not supported. Please see here for more information:
microsoft/botframework-sdk#6477

If root is an object or property in memory scope, you must use the full 'path' to that using a supported memory scope. You cannot use your own memory scope. For example if root.Site is supposed to be the same as dialog.config.Site, then you must use $dialog.config.Site.

More info on memory scopes:
https://docs.microsoft.com/en-us/composer/concept-memory?tabs=v2x#properties-and-memory-scopes

If I misunderstood the situation/scenario; please let me know and give more information that will help me understand. Thank you.

Properties and memory scopes track your bot's active state, such as conversational flows and collect information during conversations.

@dmvtech dmvtech added customer-reported Issue is created by anyone that is not a collaborator in the repository. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. Bot Services Required for internal Azure reporting. Do not delete. Do not change color. and removed needs-triage The issue has just been created and it has not been reviewed by the team. labels May 26, 2022
@dmvtech
Copy link

dmvtech commented Jun 7, 2022

Closing due to lack of response.

@dmvtech dmvtech closed this as completed Jun 7, 2022
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. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository.
Projects
None yet
Development

No branches or pull requests

2 participants