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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Inconsistent behaviour...
Copilot Studio
Unanswered

Inconsistent behaviour in FX Formula - Trying to get Key values from object in Copliot Studio

(0) ShareShare
ReportReport
Posted on by 27

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
 }
 )

 

 

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @BenMadine ,

     

    Could you please share more details about your scenario? Which node are you using in this topic?

     

    If I use a message node and add an adaptive card, no error emerged. Could you share some screenshots?

     

    Best regards,

  • BenMadine Profile Picture
    27 on at

    Hi,

     

    I am trying to pass in the results of a Servicenow Connector to a Generative Answers Node. I have the Connector which is returning results and then I am trying to format the results in a format that the Generative Answers Node can read. So 

    ForAll(
     Topic.GetRecords.result,
     {
     Content: Concatenate("active", " - ", "approval"),
     ContentLocation: "activity_due"
     }
     )

    writing the code like that works because Im passing in 'active' as a string. However 'active' is a key in the object returned from the Servicenow Connector results so it should recognise it as a key, no? It recognises the keys from the Servicenow Knowledge Base Connector, so I am unsure why it doesnt with the Get Records Connector?

     

    I have attached images of the flow, the formula with issues and the formula with the working knowledge base connector keys.

     

    Thanks,

    Ben

    image.png
    image.png
    image.png
  • MattJimison Profile Picture
    579 Most Valuable Professional on at

    Hi, @BenMadine .

     

    The reason you see different behavior between the 2 different ServiceNow actions is because the "List Records" action doesn't come back with a typed result that is aware of the columns retrieved in the table, because it can bring back content from any table in ServiceNow. The reason the Knowledge Articles action works is because it knows the data its bringing back and the connector provides that schema within its return value.

     

    If you look at the schema of the List Records' GetRecords record you'll see it's:

     

    kind: Record
    properties:
     result:
     order: 0
     type:
     kind: Table
     properties:
     Value: Any

     

     

    That's the crux of the issue for this particular connector, where its saying the result table can contain any number of properties (columns). This is why you see errors trying to refer to the active, activity_due, etc. columns, because it has no idea what those are.

     

    Cheers,

    Matt

     


    Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.

    Cheers,
    Matt

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 612

#2
chiaraalina Profile Picture

chiaraalina 161 Super User 2026 Season 1

#3
deepakmehta13a Profile Picture

deepakmehta13a 116

Last 30 days Overall leaderboard