Way to "see" what fields are rendered via form widget on service portal?

Bob Loblaw
Mega Guru

Hello -- I have created a widget on a page in service portal called "customer input". This widget calls "$sp.getWidget('widget-form')" in the server script which allows the fields to be displayed on the page. There is also a client script that runs on onLoad that hides various fields based on different conditions, so when the page is rendered in service portal, certain fields will show and others will be hidden.

 

Knowing all this, is there a way that my "customer input" widget can determine/"see" which fields are being shown after the widget loads? Is there something like "g_form.getValue(fieldName)" for the widget client script?

 

Thanks!

2 REPLIES 2

Manmohan K
Tera Sage

Hi @Bob Loblaw 

 

Press ctrl and right click on your widget and then select Instance options. Depending on the widget type - It may show you list of fields that are to be shown when widget loads

 

ManmohanK_0-1687361390726.png

 

Thanks, but I was looking for a way to do this via script in the client controller. What I ultimately want to do is to put a list of fields that are visible on the service portal widget into an array.