Skip to main content

Notifications

Building Copilot Studio Chatbots in Microsoft T...
Unanswered

Microsoft Teams does not show citation links

Posted on by

I'm working on a chatbot that reads some PDF files through documents uploaded directly to the Generative AI part. At the beginning of the tests, it brought the citations with the links, but it stopped linking. Now it only displays the information as: "Item name [1]" but without any link.

 

The links normally appear in the Copilot Test.

 

Captura de Tela 2023-12-20 às 14.35.55.png

 

Captura de Tela 2023-12-20 às 14.36.21.png

 

I tested some solutions listed here, like "https://powerusers.microsoft.com/t5/Building-Copilot-Studio-Chatbots/Citations-references-not-showing-in-the-chat-in-Teams-but/ m-p/2445958#M1435" and "https://powerusers.microsoft.com/t5/Building-Copilot-Studio-Chatbots/Citations-for-SharePoint-links-not-working-for-Teams-bot-but/m-p /2504586#M1564" but I was unable to apply them successfully.

Categories:
  • abbastailor Profile Picture
    abbastailor on at
    Re: Microsoft Teams does not show citation links

    I've tried this approach. I am sending the citations as a part of a different adaptive card. Almost all citations are showing correctly but there's one reference with title : "FAQs". Copilot studio identifies it as a citation and again moves it to the dropdown and hence that one link does not show in teams.

    abbastailor_0-1714110984423.png

     

  • theMac Profile Picture
    theMac 203 on at
    Re: Microsoft Teams does not show citation links

    mah I tested both codes and in both cases I get the error you can see attached: the adaptive card doesn't have a valid OutputType but it doesn't seem a thing I can adjust.
    Anyway my target would be to intercept the answer generated and remove the links to the file I gave to copilot as data source (I would leave the links to the public websites and remove the others)

  • ill8 Profile Picture
    ill8 4 on at
    Re: Microsoft Teams does not show citation links

    looks like solution is here Solved: Re: Citations / references not showing in the chat... - Page 2 - Power Platform Community (microsoft.com): "

    The last thing you want to do is to update the condition to catch blank answers.

    Otherwise, blank answers are not exactly outputting as a blank record, but {}.

    Instead of the Topic.Answer variable, change it to the Topic.Answer.Text one:

    "

  • theMac Profile Picture
    theMac 203 on at
    Re: Microsoft Teams does not show citation links

    @HenryJammesWell I changed the variable Answer from Local to Global and made it including complete format.
    Now I've an error in formula "The 'If' function has invalid arguments." referred to if(IsBlank(Url))

  • theMac Profile Picture
    theMac 203 on at
    Re: Microsoft Teams does not show citation links

    I'd like to do the same on my chatbot but it seems I have another interface: are you using Copilot Studio to do that?
    May you explain to me how can I change the Answer in a globalVariable??
    ok solved

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: Microsoft Teams does not show citation links

    Hi @AnithaBM 

     

    A prerequisite to access the full answer and its citations is to save it in a "complete" format:

     

    HenryJammes_0-1704198239320.png

     

     

     

  • AnithaBM Profile Picture
    AnithaBM 2 on at
    Re: Microsoft Teams does not show citation links

    when I add  Global.Answer as suggested in the post and try to edit the json formula. I get an error saying "invalid use of ."

    Global.Answer selection

    AnithaBM_1-1703667180751.png

     

    Json formula

    AnithaBM_0-1703667009853.png

     

     

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: Microsoft Teams does not show citation links

    Hi @HenriqueGauge 

     

    I got something similar working by accessing the generated answer citation text.

    E.g.: when both content from public website and document is retrieved:

     

    HenryJammes_0-1703164260342.png

     

    When clicking on the citation that doesn't have a URL, I display the full source citation:

     

    HenryJammes_1-1703164296116.png

     

    This also works over the Teams channel:

     

    HenryJammes_2-1703164315942.png

     

    Assuming you are saving the generated answer with a complete format (in my example below, I stored it as a global variable, referenced by Global.Answer) this is the Power Fx formula I've used for the adaptive card.

     

     

    {
     type: "AdaptiveCard",
     '$schema': "http://adaptivecards.io/schemas/adaptive-card.json",
     version: "1.5",
     body: [
     {
     type: "Container",
     items: [
     {
     type: "TextBlock",
     // Generated answer text
     text: Global.Answer.Text.Content,
     wrap: true
     }
     ]
     },
     {
     type: "Container",
     items: ForAll(Global.Answer.Text.CitationSources,
     
     // If the citation doesn't have a URL, display the source text snippet when the source is clicked
     If(IsBlank(Url),
     
     {
     type: "Container",
     items: [
     {
     type: "TextBlock",
     text: "[" & Id & "] " & Name & " (click to see citation)",
     wrap: true,
     size: "Small",
     weight: "Lighter"
     },
     {
     type: "TextBlock",
     text: Text,
     wrap: true,
     isVisible: false,
     id: "citationText" & Id,
     size: "Small",
     isSubtle: true
     }
     ],
     selectAction: {
     type: "Action.ToggleVisibility",
     targetElements: [ "citationText" & Id ]
     }
     },
    
     // If the citation has a URL, make the citation clickable and open the source URL.
     {
     type: "TextBlock",
     text: "[" & Id &"]: [" & Name & "](" & Url & ")",
     wrap: true,
     size: "Small",
     weight: "Lighter"
     }
    
     )
     )
     },
     {
     type: "Container",
     items: [
     {
     type: "ColumnSet",
     columns: [
     {
     type: "Column",
     width: "90",
     items: [
     {
     type: "TextBlock",
     text: "AI-generated answer. Please rate it",
     wrap: true,
     size: "Small",
     color: "Accent"
     }
     ]
     },
     {
     type: "Column",
     width: "5",
     items: [
     {
     type: "TextBlock",
     text: "",
     wrap: true,
     size: "Small",
     color: "Light"
     }
     ],
     selectAction: {
     type: "Action.Submit",
     data: "This generated answer wasn't useful"
     }
     },
     {
     type: "Column",
     width: "5",
     items: [
     {
     type: "TextBlock",
     text: "",
     wrap: true,
     size: "Small",
     color: "Light"
     }
     ],
     selectAction: {
     type: "Action.Submit",
     data: "This generated answer was useful"
     }
     }
     ]
     }
     ]
     }
     ]
    }

     

     

    Note: I don't believe the thumbs up/down buttons would work in Teams as it expects a specific format for actions (Add card actions in a bot - Teams | Microsoft Learn), so you should perhaps remove them.

     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Getting Started…

Welcome to the Power Platform Community! We appreciate your visit…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 138,006

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,059

Leaderboard

Featured topics