I have created a custom copilot to summarize the output of the power automate flow.
Here is the power automate flow.
The output of the flow. (string(outputs('Get_items')?['body/value']))
Below is the flow of the custom copilot to get the summary.
Below is the body of the power automate flow which is in string format.
{ "full_details": "[{\"@odata.etag\":\"\\\"1\\\"\",\"ItemInternalId\":\"6\",\"ID\":6,\"Client\":{\"@odata.type\":\"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference\",\"Id\":1,\"Value\":\"Access \"},\"Client#Id\":1,\"CaseStudy\":\"Loan Processing System\",\"Details\":\"Automate Loan Delinquency Report \",\"Domain\":{\"@odata.type\":\"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference\",\"Id\":1,\"Value\":\"BFS\"},\"Domain#Id\":1,\"Subdomain\":{\"@odata.type\":\"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference\",\"Id\":1,\"Value\":\"Banking\"},\"Subdomain#Id\":1,\"{Identifier}\":\"Lists%252fProjectInformations%252f6_.000\",\"{IsFolder}\":false,\"{Thumbnail}\":{\"Large\":null,\"Medium\":null,\"Small\":null},",\"{Name}\":\"\",\"{FilenameWithExtension}\":\"\",\"{Path}\":\"Lists/ProjectInformations/\",\"{FullPath}\":\"Lists/ProjectInformations/6_.000\",\"{HasAttachments}\":false,\"{VersionNumber}\":\"1.0\"},{\"@odata.etag\":\"\\\"1\\\"\",\"ItemInternalId\":\"7\",\"ID\":7,\"Client\":{\"@odata.type\":\"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference\",\"Id\":2,\"Value\":\"ab Kapital\"},\"Client#Id\":2,\"TypeofProject\":{\"@odata.type\":\"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference\",\"Id\":1,\"Value\":\"Advisory\"},\"TypeofProject#Id\":1,\"CaseStudy\":\"PCI DSS Compliant Payment Solution\",\"Details\":\"Identify the data flows, business processes, facilities, IT support systems and card holder data environment. Identify payment systems and third party service providers ,With the increase in payment card security breaches, client envisioned implementing PCI DSS compliant practices to mitigate the risk of fraud \\n \",\"Domain\":{\"@odata.type\":\"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference\",\"Id\":1,\"Value\":\"BFS\"},\"Domain#Id\":1,\"Subdomain\":{\"@odata.type\":\"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference\",\"Id\":2,\"Value\":\"Financial Services\"},\"Subdomain#Id\":2,\"{Identifier}\":\"Lists%252fProjectInformations%252f7_.000\",\"{IsFolder}\":false,\"{Thumbnail}\":{\"Large\":null,\"Medium\":null,\"Small\":null},\"{Link}\":,\"{Name}\":\"\",\"{FilenameWithExtension}\":\"\",\"{Path}\":\"Lists/ProjectInformations/\",\"{FullPath}\":\"Lists/ProjectInformations/7_.000\",\"{HasAttachments}\":false,\"{VersionNumber}\":\"1.0\"}]" }
I am not getting any output from the Generative Answers instead getting error.
Error Message: Missing or invalid assignment for variable ‘searchResult.Content’. Error Code: MissingOrInvalidRequiredProperty Conversation Id: c26a4f4a-9f45-4b55-983c-a8088339f7c9 Time (UTC): 2024-05-02T08:58:25.224Z
What should I add in schema of parse value action?
Please help me to get the summary of the power automate data.
@HenryJammes @RezaDorrani @dewainr
There's no need to remove the root object, PowerFX can traverse nested objects as well:
- kind: SetVariable
id: setVariable_8lt5XR
variable: Topic.formattedResults
value: |-
=ForAll(Topic.parsedResults.full_details,
{
Content: Details
})
Hi @likhithd15
It appears there's an issue with the JSON format. Remove the "{ "full_details": " part, so the remaining part can be considered JSON arrayIf this was helpful:
⭐Please mark it as a solution
⭐Give me a thumbs-up
⭐Connect on LinkedIn
⭐I consistently upload technical videos. If you're interested, please visit and subscribe to my YouTube Channel
⭐Always glad to help, Umesh Khandelwal!.
Hi @Umianta ,
Thank you for your response.
I have added the below formula in set variable but it's not working.
ForAll(Topic.Var2.value,
{
Content: "Details" - Details ,
ContentLocation: Blank()
}
Hi @likhithd15
Generative Answers requires the custom data value to be structured in the following format.
[ { Content: "This is a sample piece of text that was provided for testing purposes, to be replaced with content of your choice", ContentLocation: "https://contoso.com/p1.htm", Title: "Contoso Sample" }, { Content: "This is a second bit of sample text that can be replaced with content of your choice", ContentLocation: "https://fabrikam.com/p2.htm" }, { Content: "This is a third bit of sample text that can be replaced with content of your choice", Title: "Adventure Works Cycles Sample" } ]
You need to parse the flow response and transform it into like above format. For more information, refer to the documentation provided at https://learn.microsoft.com/en-us/microsoft-copilot-studio/nlu-generative-answers-custom-dat
If this was helpful:
⭐Please mark it as a solution
⭐Give me a thumbs-up
⭐Connect on LinkedIn
⭐I consistently upload technical videos. If you're interested, please visit and subscribe to my YouTube Channel
⭐Always glad to help, Umesh Khandelwal!