The CreatorCon Call for Content is officially open! Get started here.

How to populate article body html in custome table same value should populate knowledge article body

Brahmi Pandla
Tera Guru

Hi Everyone

 

I have Article body field (html type) in Custom table and Same value need to populate Article body field in knowledge table. could you please any one help on this

 

1 ACCEPTED SOLUTION

Vishal Birajdar
Giga Sage

Hi @Brahmi Pandla 

 

You can write business rule on custom table.

 

onAfter/onBefore business rule (depend upon your need)

 

/* Get custom tables article body */
var body = current.getValue('custom_body_field_name');

/* Glide record on  kb_knowledge table*/

var grKb = new GlideRecord('kb_knowledge');
grKb.addQuery('number','KB articleNUmber');  //you can adjust your query how and which KB article you want to update. better to get value from custom table

grKb.query();

if(grKb.next()){
    grKb.setValue('text',body);
    grKb.update();
}

/* Yo can adjust your code accordingly */

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

View solution in original post

1 REPLY 1

Vishal Birajdar
Giga Sage

Hi @Brahmi Pandla 

 

You can write business rule on custom table.

 

onAfter/onBefore business rule (depend upon your need)

 

/* Get custom tables article body */
var body = current.getValue('custom_body_field_name');

/* Glide record on  kb_knowledge table*/

var grKb = new GlideRecord('kb_knowledge');
grKb.addQuery('number','KB articleNUmber');  //you can adjust your query how and which KB article you want to update. better to get value from custom table

grKb.query();

if(grKb.next()){
    grKb.setValue('text',body);
    grKb.update();
}

/* Yo can adjust your code accordingly */

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates