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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Using the "Custom Data...
Copilot Studio
Unanswered

Using the "Custom Data" option in "Create generative answers" in copilot studio

(1) ShareShare
ReportReport
Posted on by 23

Hi! I am testing some different features of copilot studio, and I got interested in testing using the "Generative answers" action using "Custom data". 

 

victoriag_0-1705308347985.png

Looking at the documentation, it seems like it would be possible to use the output from a power automate flow, send it back to copilot studio, and create a generative answer based on this. The documentation shows that the input to the "custom data" field takes a json array of objects. 

victoriag_1-1705308752511.png

 

As an initial test I wanted to return the sample json in the screenshot above from power automate, send it to copilot studio and use this data to set the custom data field in the "Create generative answer" action. 

 

Inside power automate.

I set the example data from the screenshot above inside "compose", parse it and then return it to copilot. 

victoriag_3-1705308962695.png

I return the "body" and this is how it looks like inside power automate. I return it as a string type because it does not seem like it is any other suitable alternatives to return a json/array or table. 

victoriag_5-1705309075932.png

Below is a screenshot of the "output", I return the "body"-field. 

 

victoriag_4-1705309064289.png

 

Inside Copilot studio. 

I call the ComposeCustomData flow (ignore the input as I do not really use it for anything).

victoriag_6-1705309164861.png

First of all, if I try to run this inside copilot studio, I get the error message:

 

Error: The parameter with name customdata on the flow ComposeCustomData (bd97892b-1db1-ee11-a569-000d3adf9328) was evaluated to the type TableDataType, expected type StringDataType Error-code: FlowActionBadRequest Conversation-ID: d6fe75a7-de90-4fdb-8a74-494e303f3b71 Tid (UTC): 2024-01-12T10:02:10.696Z

 

Which makes sense I guess (?), since I try to return a json, but defined it as a string.
The reason why I'm trying to do this is because the custom data field (in the screenshot below) requires a table type. So even if I try to pass the "customData"-output from the flow, it complains that it is a string and not a table type.

 

victoriag_7-1705309320575.png

 

Am I missing something here? 😅 I am a bit confused that I cannot return any other suitable type from power automate apart from "string", and the "Custom data" field requires a "Table", but in the documentation it says that input should be a json array of objects (maybe it is the same?). Also the documentation says that the data in the "Custom data" field could be supplied from a power automate flow, so I guess it should be possible somehow. 

 

Any suggestions would be highly appreciated 😀

I have the same question (0)
  • Verified answer
    HenryJammes Profile Picture
    on at

    Hi @victoriag 

     

    Before you pass it to Generative Answers, you should use a "Parse value" node.

    You can use your sample JSON payload to automatically detect the schema for the format.

     

    From what you describe, you'll then be able to pass the desired custom data table as Topic.YourParsedVariable.body.customdata.

     

    Henry

  • victoriag Profile Picture
    23 on at

    Thank you!! This solved my problem 🙂

  • kinwong Profile Picture
    on at

    I got a similar Error Message: The parameter with name ‘spanswer’ on flow ‘POC - G&E Disclosures’ (‘6cc82777-3b7a-07a0-929b-16c38389d0e7’) evaluated to type ‘TableDataType’ , expected type ‘StringDataType’ Error Code: FlowActionBadRequest Conversation Id: cbae0d28-bd3b-448c-8ac3-b42eedb9012f Time (UTC): 2024-04-30T18:28:08.771Z

     

    It seems the error complained the output of the node below.  It expects a string data type but receive a table. This is true the output of the flow is a table, but there is no table output option in "Respond to Copilot" in Power Automate.

    kinwong_0-1714502044293.png

    I have a Parse value node after the Action node.  But the Parse value node didn't call because it was failed in the previous Action node.  

  • fernandoqc Profile Picture
    15 on at

    got the same error

  • fernandoqc Profile Picture
    15 on at

    Hey,

    I was able to resolve the issue by modifying the response parameter to remove the JSON content type.

     

    Originally: response.Content = new StringContent(outputString, Encoding.UTF8, "application/json");

    Updated to: response.Content = new StringContent(outputString, Encoding.UTF8);

     

    By doing this, the HTTP response was treated as a plain string instead of JSON. I then parsed it as a table before sending it to the genAI node.

  • Suggested answer
    CU19070401-0 Profile Picture
    32 on at
    Here is a detailed step by demo on how to use custom data with Generative Answers in Copilothttps://global-sharepoint.com/sharepoint/custom-data-source-for-generative-answers/
     
    Video on how to use custom data in Copilot Generative AIhttps://www.youtube.com/watch?v=tsUlp4DYSCk&t=1318s

    YouTube Video on Microsoft Copilot Studio Full Tutorial for Beginners, Explained Step by Stephttps://youtu.be/p5SleksT7bA



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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 265 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 240 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 101 Moderator

Last 30 days Overall leaderboard