Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenMadine
Frequent Visitor

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

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

 

 

3 REPLIES 3
v-jefferni
Community Support
Community Support

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,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

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

MattJimison
Most Valuable Professional
Most Valuable Professional

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

Helpful resources

Announcements

Copilot Cookbook Challenge | Week 1 Results | Win Tickets to the Power Platform Conference

We are excited to announce the "The Copilot Cookbook Community Challenge is a great way to showcase your creativity and connect with others. Plus, you could win tickets to the Power Platform Community Conference in Las Vegas in September 2024 as an amazing bonus.   Two ways to enter: 1. Copilot Studio Cookbook Gallery: https://aka.ms/CS_Copilot_Cookbook_Challenge 2. Power Apps Copilot Cookbook Gallery: https://aka.ms/PA_Copilot_Cookbook_Challenge   There will be 5 chances to qualify for the final drawing: Early Bird Entries: March 1 - June 2Week 1: June 3 - June 9Week 2: June 10 - June 16Week 3: June 17 - June 23Week 4: June 24 - June 30     At the end of each week, we will draw 5 random names from every user who has posted a qualifying Copilot Studio template, sample or demo in the Copilot Studio Cookbook or a qualifying Power Apps Copilot sample or demo in the Power Apps Copilot Cookbook. Users who are not drawn in a given week will be added to the pool for the next week. Users can qualify more than once, but no more than once per week. Four winners will be drawn at random from the total qualifying entrants. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once. If they are drawn multiple times, another user will be drawn at random. Prizes:  One Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value, does not include travel, lodging, or any other expenses) Winners are also eligible to do a 10-minute presentation of their demo or solution in a community solutions showcase at the event. To qualify for the drawing, templates, samples or demos must be related to Copilot Studio or a Copilot feature of Power Apps, Power Automate, or Power Pages, and must demonstrate or solve a complete unique and useful business or technical problem. Power Automate and Power Pagers posts should be added to the Power Apps Cookbook. Final determination of qualifying entries is at the sole discretion of Microsoft. Weekly updates and the Final random winners will be posted in the News & Announcements section in the communities on July 29th, 2024. Did you submit entries early?  Early Bird Entries March 1 - June 2:  If you posted something in the "early bird" time frame complete this form: https://aka.ms/Copilot_Challenge_EarlyBirds if you would like to be entered in the challenge.   Week 1 Results:  Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Copilot Cookbook Gallery:Power Apps Cookbook Gallery:1.  @Mathieu_Paris 1.   @SpongYe 2.  @Dhanush 2.   @Deenuji 3.  n/a3.   @Nived_Nambiar  4.  n/a4.   @ManishSolanki 5.  n/a5.    n/a

Your Moment to Shine: 2024 PPCC’s Got Power Awards Show

For the third year, we invite you, our talented community members, to participate in the grand 2024 Power Platform Community Conference's Got Power Awards. This event is your opportunity to showcase solutions that make a significant business impact, highlight extensive use of Power Platform products, demonstrate good governance, or tell an inspirational story. Share your success stories, inspire your peers, and show off some hidden talents.  This is your time to shine and bring your creations into the spotlight!  Make your mark, inspire others and leave a lasting impression. Sign up today for a chance to showcase your solution and win the coveted 2024 PPCC’s Got Power Award. This year we have three categories for you to participate in: Technical Solution Demo, Storytelling, and Hidden Talent.      The Technical solution demo category showcases your applications, automated workflows, copilot agentic experiences, web pages, AI capabilities, dashboards, and/or more. We want to see your most impactful Power Platform solutions!  The Storytelling category is where you can share your inspiring story, and the Hidden Talent category is where your talents (such as singing, dancing, jump roping, etc.) can shine! Submission Details:  Fill out the submission form https://aka.ms/PPCCGotPowerSignup by July 12th with details and a 2–5-minute video showcasing your Solution impact. (Please let us know you're coming to PPCC, too!)After review by a panel of Microsoft judges, the top storytellers will be invited to present a virtual demo presentation to the judges during early August. You’ll be notified soon after if you have been selected as a finalist to share your story live at PPCC’s Got Power!  The live show will feature the solution demos and storytelling talents of the top contestants, winner announcements, and the opportunity to network with your community.  It's not just a showcase for technical talent and storytelling showmanship, show it's a golden opportunity to make connections and celebrate our Community together! Let's make this a memorable event! See you there!   Mark your calendars! Date and Time: Thursday, Sept 19th Location: PPCC24 at the MGM Grand, Las Vegas, NV 

Tuesday Tip | Accepting Solutions

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   To enhance our collaborative environment, it's important to acknowledge when your question has been answered satisfactorily. Here's a quick guide on how to accept a solution to your questions: Find the Helpful Reply: Navigate to the reply that has effectively answered your question.Accept as Solution: Look for the "Accept as Solution" button or link, usually located at the bottom of the reply.Confirm Your Selection: Clicking this button may prompt you for confirmation. Go ahead and confirm that this is indeed the solution.Acknowledgment: Once accepted, the reply will be highlighted, and the original post will be marked as "Solved". This helps other community members find the same solution quickly. By marking a reply as an accepted solution, you not only thank the person who helped you but also make it easier for others with similar questions to find answers. Let's continue to support each other by recognizing helpful contributions. 

Reminder: To register for the Community Ambassador Call on June 13th

Calling all Super Users & User Group Leaders   Reminder: To register for the Community Ambassador Call on June 13th—for an exclusive event for User Group Leaders and Super Users! This month is packed with exciting updates and activities within our community.   What's Happening: Community Updates: We'll share the latest developments and what's new in our vibrant community.Special Guest Speaker: Get ready for an insightful talk and live demo of Microsoft Copilot Studio templates by our special guest.Regular Updates: Stay informed with our routine updates for User Groups and Super Users.Community Insights: We'll provide general information about ongoing and upcoming community initiatives. Don't Miss Out: Register Now: Choose the session that fits your schedule best.Check your private messages or Super User Forum for registration links. We're excited to connect with you and continue building a stronger community together.   See you at the call!  

Tuesday Tip | How to Provide Feedback

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We are always looking to improve your experience on our community platform, and your feedback is invaluable to us. Whether it's a suggestion for a new feature, an idea to enhance the platform, or a concern you'd like to address, we want to hear from you!   How to Share Your Feedback: Each of our communities has its own Feedback forum where the Community Managers can assist you directly in.  ●  Power Apps  ● Power Automate   ● Power Pages   ● Copilot Studio   We also have many articles on community account FAQs, or how to navigate the community, which can be found below.   Community Accounts & Registration:  https://powerusers.microsoft.com/t5/Community-Accounts-Registration/tkb-p/pa_community_accounts_regi...   Using the Community: https://powerusers.microsoft.com/t5/Using-the-Community/tkb-p/pa_using_the_community   Our Commitment to You: We are committed to creating a collaborative and supportive environment. All feedback is reviewed by our community managers, and we strive to implement changes that will benefit all members.   Thank you for being a part of our community. Your contributions help us grow and improve together!

Update: Copilot Studio Community | Forums & Blogs have MOVED

Get ready to experience a whole new level of engagement with the Copilot Studio Community beginning this June! We’re thrilled to announce significant enhancements to our Community Blogs and Forums, designed to foster collaboration, creativity, and connection in the Community. 🚀💡   Note: As we continue our journey towards a fully updated platform, we want to keep you informed of the current known issues you may encounter on the Community site: Deep Link Discrepancies:​​​​​​​ You may find that previously saved deep links are not functioning as expected. They are currently redirecting to the "Read Only" Forums & Blog boards.  We understand the inconvenience this may cause and we are working to resolve the issue.  In the meantime, you can access the updated: Copilot Community Blogs & Copilot Community Forum Boards and save the new deep links. ​​​​​​​Profile and Contribution visibility: Your profile, contributions, badges and other related elements may appear incomplete or not fully updated.  Rest assured; this is a temporary state due to the ongoing transition.  We are making every effort to ensure a complete and accurate migration of all of your valuable contributions.     What’s New? 🌟 Revamped Community Blogs: Dive into a more intuitive and enriched blogging experience, where sharing knowledge and insights is easier and more enjoyable than ever. Enhanced Forums: Engage in discussions, ask questions, and connect with peers through our improved forums, now with better navigation and user-friendly features.  Why Check It Out? ✔ Stay Informed: Keep up with the latest trends, tips, and tricks from Copilot experts and fellow community members.Expand Your Network: Connect with like-minded professionals and build lasting relationships within the community.Share Your Voice: Contribute your own stories, solutions, and successes to inspire and educate others.   Stay tuned for more details as we approach the launch date. We can’t wait for you to join us in this new chapter of the Copilot Studio Community. Together, let’s make it a hub of innovation and inspiration!   

Users online (6,202)