web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / null handling in Adap...
Copilot Studio
Unanswered

null handling in Adaptive Card formula

(0) ShareShare
ReportReport
Posted on by 1
I'm customizing Adaptive Card to display generative answer's citations because Virtual Agent in Teams does not show citations well.
My current code is this.
{
    type: "AdaptiveCard",
    '$schema': "http://adaptivecards.io/schemas/adaptive-card.json",
    version: "1.5",
    body: [
        {
            type: "Container",
            items: ForAll(Topic.Answer.Text.CitationSources,
            {
            type: "TextBlock",
            text: "[" & Id &"]:[" & Name & "]("&Url&")",
            wrap: true,
            size: "Small",
            weight: "Lighter"
            }
            )
        }
    ]
}
 
In case the citation link referring to SharePoint Document Library Files or Public Web Sites, this works well.
 
However, when generative answer refers to SharePoint Modern Page, chat bot returns "SystemError".
In this case, Answer variable is as below.
{
  "Text": {
    "CitationSources": [
      {
        "Id": "1",
        "Name": null,
        "Text": "Page Description",
        "Url": "https://mydomain.sharepoint.com/sites/sitename/SitePages/XXXX.aspx"
      }
    ],
    "Content": "Generative Answer Description [1].",
    "MarkdownContent": "Generative Answer Description [1].\n\n[1]: https://mydomain.sharepoint.com/sites/sitename/SitePages/XXXX.aspx"
  }
}
I think SystemError occurs due to citation item's name is null.
I tried to change  the Adaptive Card formula like
            text: "[" & Id &"]:[" & If(IsBlank(Name), "Link", Name) & "]("&Url&")",
or 
            text: "[" & Id &"]:[" & If(IsBlankOrError(Name), "Link", Name) & "]("&Url&")",
the result was same.
 
Is there any good way to handle null validation.
Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Copilot Studio

#1
Mohsin Ali Profile Picture

Mohsin Ali 320

#2
Valantis Profile Picture

Valantis 173 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 139 Super User 2026 Season 2

Last 30 days Overall leaderboard