how to display some fields in the portal page

poornima batchu
Tera Expert

HI all,

 I am trying to show few fields in the portal page. similar to like a section in the portal like the additional details and activity . How to achieve this please guide me to get this. find_real_file.png

thank you.

3 REPLIES 3

Mohith Devatte
Tera Sage
Tera Sage

Hello Poornima,

You need to customize a widget for this.

The widget name is "Standard ticket tab" which an OOB widget and you need to clone it first in order to customize the code inside it .

1)Please clone the widget and then in your page replace the cloned widget 

2) In this code please go to server side and you can find an array call data.tabs where they are trying to push tabs  into that array and accessing those array elements in HTML to render the names and fields under it 

3) Please refer to screenshot below attached and code from OOB widget

IN THIS CODE THERE ARE PUSHING ALL SECTIONS IN TABS ARRAY IN FORMAT OF JSONS.

IN THE SAME WAY PLEASE DECALRE YOUR JSON AND PUSH IT TO TABS ARRAY JUST LIKE BELOW 

    var tabs = [];
    var config = sn_std_tkt_api.TicketConfig.getConfig(data.table, record.sys_domain);
    var isNonPrimary = ((record.isValidField('universal_request') && !record.universal_request.nil()) && (record.universal_request.primary_task != record.sys_id));
    if (!config.tabs) {
        var tab_1 = {
            name: gs.getMessage('Activity'),
            order: 0,
            widget: $sp.getWidget('std_ticket_conversations', 
                                                        {sys_id: data.sys_id, 
                                                         table:data.table,
                                                         btnLabel: gs.getMessage('Post'),
                                                         read_only: isNonPrimary || urClosedState,
                                                         rich_text_editor: options.rich_text_editor,
                                                         at_mentions: options.at_mentions
                                                        })
        };
        tabs.push(tab_1);

You can create your section like below

var tab_4={

name: gs.getMessage('My Tab 4'),
            order: 3

//call your widget to render your fields 

},

tabs.push(tab_4);

 

Please accept the solution if it helps you 

Thanks

 

Anil Lande
Kilo Patron

Hi,

Please check below links:

https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/build/service-portal/concept/st...

To add Additional tabs on your page your can use below way:

https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/build/service-portal/task/confi...

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

sharayuwank
Tera Contributor

 

 

 

Hi Poornima,
How did you achieved it I have a same requirement for additional details.
Thanks
sharayu