The Zurich release has arrived! Interested in new features and functionalities? Click here for more

UI Creation for the Gen AI(Problem RCA)

Prasanna_Patil
Tera Guru

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 ??

Please hit like and Mark Helpful if you liked it
Regards,
Prasanna
1 REPLY 1

ChrisSteinke2
ServiceNow Employee
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.