Importing knowledge Article

Abhilasha G T
Tera Contributor

Hi Team,

 

I have a knowledge article document in word format, in that there is a two fields like summary field and symptoms field having contents once I upload the word document , both the summary field and symptoms field names should be erased and the contents of those fields should get updated into the there is a description field available on the knowledge article,  for this need a fix script.

 

AbhilashaGT_0-1767099370348.png

need the above contents should get updated in the description field like below.

AbhilashaGT_1-1767099485589.png

 

Kindly help on this to achieve.

 

Regards,

Abhilasha G T

3 REPLIES 3

TejasSN_LogicX
Tera Contributor

Hi @Abhilasha G T  ,

You can fix this by creating a Before Business Rule on the  table that runs when a record is created. The rule will get the Description field value, remove the field names like Summary and Symptoms, and clean the content before the record is inserted into the database.

 

business rule  script :

add this script in your businness rule 

var desc = current.description + '';

// Remove field names "Summary" and "Symptoms" (case-insensitive)
desc = desc.replace(/^Summary\s*/im, '');
desc = desc.replace(/^Symptoms\s*/im, '');

// Remove extra line breaks
desc = desc.replace(/\n+/g, '\n').trim();

// Update the Description field
current.description = desc;

 

if you  already have too many records in the table then you can run the background script or fix scripts 

 

 

thanks,

tejas

Hi @TejasSN_LogicX ,

Thanks for your reply , its not working.

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Abhilasha G T I’m not sure what your use case is, but before you proceed, please check whether the description field length is sufficient to store both the summary and the description together. I don’t think combining everything is a good approach. We faced a similar issue earlier when importing data into the system in the same way. It would be better to first implement the solution properly and then make the change, or run a script to fix the issue afterward.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************