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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 08:14 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 08:30 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 09:39 AM
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.