Skip to content

[.NET][Templating] Null Substitution not working #5963

@Greg-Hitchon

Description

@Greg-Hitchon

Target Application

Rendering in nodejs and/or Outlook, created using dotnet (AdaptiveCards.Templating 1.2.1, AdaptiveCards 2.7.1)

Problem Description

Trying to render cards with null substitution, but not able to do so:

string cardJson = template.Expand(data, (name) => "something");

Expected Outcome

The card should have the substitution text rendered (in this case "something")

Actual Outcome

The tag is displayed like ${NullTagThatShouldBeReplaced}

Repro Steps

            AdaptiveCardTemplate template = new(text);
            var data = new
            {
                NullTagThatShouldBeReplaced= null
            };

            string cardJson = template.Expand(data, (name)=> "something");

            AdaptiveCardParseResult parseResult = AdaptiveCard.FromJson(cardJson);
            AdaptiveCard adaptiveCard = parseResult.Card;

            return adaptiveCard.ToJson();

Schema Version

1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions