Script working to display HTML response in backend form not working on Employee Center

Josh Evans
Tera Contributor

Hello,

 

I am having issues getting an html response to parse into the Employee Center field that I am passing it into. It is working fine on the backend service catalog, but once I attempt it on the employee center it appears to not pass anything through and is just blank.

 

See screenshots below for code snippets and configuration. Any help would be appreciated. 

 

Thanks

 

function SODResultsParse(response){
    alert(response);
    g_form.setValue('sod_results',response);
    //g_form.setLabelOf('sod_results','');
    //g_form.setValue('allow_submit',true);

    //begin INC0261028
    var sod_res = g_form.getValue('sod_results');
    if(sod_res.indexOf("Risk ID") > 0) {
        g_form.setValue('sod', 'Yes');
    } else {
        g_form.setValue('sod', 'No');
    }
    //end INC0261028
   
}
 
First screenshot is the alert on the employee center.
3 REPLIES 3

Josh Evans
Tera Contributor

Additionally here is the variable config that I am passing the response to.

pass variable.PNG

@Josh Evans ,

 

I was able to do this on the employee center and it worked pretty much OOTB.

I would suggest removing any additional styles for testing and checking if the widget is OOTB.

 

Maybe you can add some default value for the HTML field and check if it renders.

 

ahefaz1_4-1706159155002.png

 

 

Below is what worked for me.

 

ahefaz1_0-1706158985608.png

 

ahefaz1_1-1706159006529.pngahefaz1_2-1706159021448.png

 

ahefaz1_3-1706159041052.png

 

Please accept solution OR mark helpful.

 

Thanks,

Thank you for your response. Would the variable being read only prevent it from populating on the employee center and not on the service catalog?