Adding an element to $sp.getKBCategoryArticleSummaries

Garrett2
Tera Expert

I'm looking at the category article widget, specifically this block.

if (kb_cat.get(data.category)) {
  data.categoryExists = true;
  data.categoryDisplay = kb_cat.getDisplayValue();
  data.items = $sp.getKBCategoryArticleSummaries(data.category, data.limit + 1 , 250);
}

getKBCategoryArticleSummaries pulls something like this for all of the articles in those categoies:

author: "Knowledge Team"
kb_category: "2f165e121b231410b8f54158dc4bcb18"
number: "KB0012156"
published: "2020-11-17"
rating: ""
short_description: "List/delist products to a channel"
sys_id: "448b1429db6420107c896c3913961925"
sys_updated_on: "2020-12-03 15:54:11"
sys_view_count: 0
text: "List/delist products to a channel↵  You have imported your product data, configured the product data to send to the channels, and configured the listing, order sync, and buffer quantity settings. Now, you are ready to list products..."
title: "List/delist products to a channel"
type: "kb_article"
_table_name: "kb_knowledge"

And I want to add the custom field u_order from the kb_knowledge (my articles) table to that list. 

I tried using a "push" but I don't seem to be building the command properly.

Any advice on how I can do this?

1 ACCEPTED SOLUTION

rahulpandey
Kilo Sage

Hi Garret

Can you try below logic

 

for (var i=0; i<data.items.length; i++){
data.items[i].order = gr.u_order// replace it with you logic to populate the value
}

View solution in original post

1 REPLY 1

rahulpandey
Kilo Sage

Hi Garret

Can you try below logic

 

for (var i=0; i<data.items.length; i++){
data.items[i].order = gr.u_order// replace it with you logic to populate the value
}