UI Creation for the Gen AI(Problem RCA)

Prasanna_Patil
Kilo Sage

Hello Everyone

 

I am working on creating RCA for the problem using Gen AI. I have created a prompt successfully considering "Cause notes" & "Fix Notes" and getting result when i run the Test run. However i want to create a UI action called "Summarize RCA", so that when i hit the UI action automatically problem's "Cause notes" and "Fix notes" should update.

 

Can some one please help with the UI action code which does this action ??

1 REPLY 1

ChrisSteinke2
ServiceNow Employee

Its easy, you just need to generate the UI Action as normal from the Skill Kit, then update the auto-generated script to put the values into the fields. This is an example from a use case where I wrote the response into the Backout Plan field:

try {
    var response = sn_one_extend.OneExtendUtil.execute(request) || {};
    var skillResponse = ((response["capabilities"] || {})[capabilityId] || {})["response"];
    var cleanedoutput = JSON.parse(skillResponse.replace('Info Message', '')).model_output.trim();
    current.backout_plan = new Date().toLocaleString() + '\n\n' + ((cleanedoutput)) + '\n\n' + '*** Backout Plan generated by NowLLM ***';
    current.update();
 
Full code is available here.