Skip to main content

Notifications

Copilot Studio - General
Answered

Copilot Bot Returns Limited Results Instead of Full Dataset

(2) ShareShare
ReportReport
Posted on by 9

I am using a Copilot bot in Copilot Studio to query a dataset from a Dataverse table which i have include in the Knowledge. When I ask the bot a question like:

"What are the average final count scores for all dealers in the format: Dealer: [Dealer Code], Score: [Average Score]? Please list all dealers without limiting the output."

The bot only returns a small subset of results (e.g., 2-3 records) instead of listing all matching records from the table. The dataset has 7 entries, and I need the bot to return the entire dataset in the response.

I have tried:

  1. Explicitly requesting the bot to list all results without limiting the output.
  2. Validating that the data exists in the table.

Despite this, the bot seems to truncate the response automatically. Is there a way to adjust the bot's behavior or configuration to ensure it returns the complete dataset instead of just a sample?

P.S.: The same issue occurs in whatever question i ask! Always returning 3 records instead of the whole list of results.

Categories:
  • Suggested answer
    A.Tara Profile Picture
    A.Tara 9 on at
    Copilot Bot Returns Limited Results Instead of Full Dataset
    @ST-22010711-0 I fixed my issue based on the reply from @Artur Stepniak.
    There are two ways you can use. The first one is to create an Action, in my case i used the action Dataverse - List all rows from selected environment, added it and then configured its Input by adding the Environment, Table and as an extra i added the Select Columns in which i set as value the logical name of my table (the table i wanted to list the data from). Then in my Topic i added an action > Call an Action > (Tab) Plugin (Preview) and from there i picked the Action i created. In the newly created action i added an output variable in order to store the results in there and i looped through this Variable using the Foreach which i found from here: https://github.com/pnp/powerplatform-snippets/tree/main/copilot-studio/foreach-topic/
    My code looks like this:
     - kind: BeginDialog
                              id: blahblah
                              input: {}
                              dialog: BotName.component.MicrosoftDataverse-Listrowsfromselectedenvironment
                              output:
                                binding:
                                  value: Topic.DealerOutput  #The variable i created to store the results
     
                            - kind: Foreach
                              id: TamaGa
                              items: =Topic.DealerOutput
                              value: Topic.CurrentDealer
                              actions:
                                - kind: SendActivity
                                  id: OZIkYY
                                  activity: "{Topic.CurrentDealer.dataverseTableLogicalName}"

     
    This concludes my first approach. Now, for the second way i found which in my opinion is more straightforward.
    I used a Connector Action as shown below. (In my case i added the List rows from selected environment)
     
    With this approach you can add an OData query for more complex results.
    I wanted to calculate the average of the numeric values from four different columns and find which has score less than 4.90 and fetch the value and the dealer which has this value.

    *The above is a different print screen to demonstrate how you can make use of the Filter Rows in a more simple way*
    For my case, i left the Filter Rows empty and just inserted my columns in the Select Columns section and then i created a variable which calculates the Average.
     
    Below a screenshot and the code i used to create it.
     
    - kind: Foreach
                              id: vtX27Cad
                              items: =Topic.AverageFinalCount
                              value: Topic.CurrentDealer
                              actions:
                                - kind: SetVariable
                                  id: CalculateAverage
                                  variable: Topic.CalculateAverage
                                  value: |
                                    =(
                                      (Topic.CurrentDealer.cr3ab_en1_finalcount + 
                                       Topic.CurrentDealer.cr3ab_en2_finalcount + 
                                       Topic.CurrentDealer.cr3ab_en3_finalcount + 
                                       Topic.CurrentDealer.cr3ab_en4_finalcount) / 4
                                     )
                                - kind: ConditionGroup
                                  id: conditionGroup_wodrIv
                                  conditions:
                                    - id: conditionItem_gnBiL0
                                      condition: =Topic.CalculateAverage < 4.9
                                      actions:
                                        - kind: SendActivity
                                          id: wzTSVK
                                          activity: "**Dealer Code: {Topic.CurrentDealer.cr3ab_dealer_code}, Average Score: {Topic.CalculateAverage}"
  • Verified answer
    Artur Stepniak Profile Picture
    Artur Stepniak 1,359 on at
    Copilot Bot Returns Limited Results Instead of Full Dataset
    Hello,
     
    the issue persists, because the table is just indexed - it returns the nearest neighbour based embedding on your prompt. The best way to avoid it is to use RAG technique. It means that instead of explicitly adding the data source, you can define actions for the model to query the dataset - in your case that would be Dataverse actions. The model then can generate ODATA queries quite well and filter out the table as needed. You would need to use generative orchestration though, which's still a preview feature, so not meant for production use. You also need to consider that LLMs aren't really good at math, so don't expect that it'll throw the right answer - it needs to use some kind of plugin to calculate correctly, which's not available in Copilot Studio for now. The only option to overcome this for now is to perform the calculations manually via functions and have the model return the answer embedded in its response.
     
    Hope it helps!
     
    In case of any other questions, let me know. If the answer helped you, mark it, so that others can benefit from it.
     
    Best regards,
     
    Artur Stepniak
    Interested in GenAI? Visit my site!
  • ST-22010711-0 Profile Picture
    ST-22010711-0 7 on at
    Copilot Bot Returns Limited Results Instead of Full Dataset
    I have the same issue but instead of a dataverse table as a source, it's an excel spreadsheet uploaded into the knowledgebase or stored in a sharepoint folder.
     
    Looking forward to someone from Microsoft actually replying to this and explaining how this didn't get picked up their rigorous testing!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard