Hi,
I am using Copilot Studio and I am trying to get the value of Keys from an object. This works when using the Servicenow Connector 'Get Knowledge Articles', however, it does not work when using the Servicenow Connecter 'Get Records' even though the returned object is the same, just contains different keys/values. Can someone please explain how I am able to retrieve the values form the kb connector but not the get records connector and show me where I am going wrong?
I am getting the errors: Name isn't valid. 'active' isnt recognized.
Even though the active key is in the returned object (can see from code below)
Any help would be appreciated!
Return of Servicenow Connector 'Get Knowledge Articles':
{
"articles": [
{
"id": "kb_knowledge:ac85a0c4c3437158d3649c0c050131ad",
"link": "?sys_kb_id=ac85a0c4c3437158d3649c0c050131ad&id=kb_article_view&sysparm_rank=1&sysparm_tsqueryId=c0cb94a0c3250a501074fdbb0501315b",
"number": "KB0012536",
"rank": 1,
"score": 239.6025,
"snippet": " to the Spark library of knowledge articles. Here you can find lots of useful information. <strong>Report</strong> a <strong>Fault</strong> Tile The '<strong>Report</strong> a <strong>Fault</strong>' tile is a link to the catalog of Spark forms used to raise Incidents. Browsing the 'Approvals' menu link which also has a badge to indicate <strong>how</strong> many outstanding approvals you have. From",
"title": "Tech Self Service - How to guide"
}
}
Formula to get key values from above code and to pass to Generative answer node:
ForAll(
Topic.GetKnowledgeArticles.articles, {
Content: Concatenate(title, " - ", snippet),
ContentLocation: Concatenate("https://skydev3.service-now.com/techss?id=tk_article&sys_id=", Last(Split(id, ":")).Value)
}
)
Return of Servicenow Connector 'Get Record' (I have removed some fields so it isnt as long):
{
"result": [
{
"active": "true",
"activity_due": "UNKNOWN",
"additional_assignee_list": "",
"agile_story": "",
"approval": "Not Yet Requested",
"approval_history": "",
"approval_set": "",
"assigned_to": "",
}
]
}
Formula to get key values from above code and to pass to Generative answer node:
ForAll(
Topic.GetRecords.result,
{
Content: Concatenate(active, " - ", approval),
ContentLocation: activity_due
}
)