Hi! I am testing some different features of copilot studio, and I got interested in testing using the "Generative answers" action using "Custom data".
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.
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.
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.
Below is a screenshot of the "output", I return the "body"-field.
Inside Copilot studio.
I call the ComposeCustomData flow (ignore the input as I do not really use it for anything).
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.
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 😀