<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Custom Workspace UI Action – Export Only Visible Form Fields to Excel in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3480015#M1245866</link>
    <description>&lt;P&gt;Regarding OOTB Capability:&lt;BR /&gt;Based on current ServiceNow documentation, there is NO out-of-the-box method to programmatically retrieve the list of visible form fields during UI Action execution in Workspace. The recommended approaches are:&lt;BR /&gt;Approach 1: DOM Inspection (Most Dynamic)&lt;BR /&gt;Use client-side JavaScript to inspect the rendered form and extract field names from data attributes on form elements.&lt;BR /&gt;Pros: Accurately reflects runtime visibilityCons: Fragile if DOM structure changes; requires careful selector management&lt;BR /&gt;Approach 2: Workspace Declarative Actions with Payload&lt;BR /&gt;Configure the declarative action to pass form context. Limited by what Workspace exposes in the action payload.&lt;BR /&gt;Pros: Supported approach using framework capabilitiesCons: May not include all needed field metadata&lt;BR /&gt;Approach 3: Form Section/View Configuration Query&lt;BR /&gt;Query sys_ui_section and sys_ui_element for the form view being used.&lt;BR /&gt;Pros: Server-side approach; stableCons: Does not account for UI Policy or Client Script conditional visibility&lt;BR /&gt;Recommended Best Practice:&lt;BR /&gt;Implement a hybrid solution combining DOM inspection for accuracy with server-side validation for security. Encapsulate the logic in reusable components that can be updated if ServiceNow provides better APIs in future releases.&lt;/P&gt;&lt;P&gt;RELATED DOCUMENTATION REFERENCES&lt;BR /&gt;• ServiceNow Docs: UI Actions for Workspace&lt;BR /&gt;• ServiceNow Docs: Now Experience UI Framework&lt;BR /&gt;• ServiceNow Docs: GlideAjax&lt;BR /&gt;• ServiceNow Community: Workspace Customization Best Practices&lt;BR /&gt;• ServiceNow Developer Blog: Working with UI Builder Forms&lt;/P&gt;</description>
    <pubDate>Mon, 02 Feb 2026 18:46:57 GMT</pubDate>
    <dc:creator>KingC</dc:creator>
    <dc:date>2026-02-02T18:46:57Z</dc:date>
    <item>
      <title>Custom Workspace UI Action – Export Only Visible Form Fields to Excel</title>
      <link>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3479880#M1245841</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I have a requirement in a &lt;STRONG&gt;Custom Workspace&lt;/STRONG&gt; where I created a &lt;STRONG&gt;UI Action button (Export to Excel)&lt;/STRONG&gt; on a form.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Requirement:&lt;/STRONG&gt;&lt;BR /&gt;When the user clicks the &lt;STRONG&gt;Export Excel&lt;/STRONG&gt; UI Action from Workspace:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;The Excel file should contain &lt;STRONG&gt;only the fields that are currently displayed on the Workspace form&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Only the &lt;STRONG&gt;visible form fields&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The exported Excel should include the &lt;STRONG&gt;field labels and their corresponding record data&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Fields that are &lt;STRONG&gt;hidden / not present on the form&lt;/STRONG&gt; should NOT be exported&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Context:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Workspace: Custom Workspace&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;UI Action: Workspace-compatibleForm is built using &lt;STRONG&gt;UI Builder components&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Export should be dynamic&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Is there any &lt;STRONG&gt;OOTB way&lt;/STRONG&gt; to get the list of &lt;STRONG&gt;visible form fields in Workspace&lt;/STRONG&gt; during a UI Action execution?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If not supported OOTB, what is the &lt;STRONG&gt;recommended best-practice approach&lt;/STRONG&gt; to achieve this?&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Any suggestions, examples, or documentation references would be very helpful.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 15:29:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3479880#M1245841</guid>
      <dc:creator>dattanarend</dc:creator>
      <dc:date>2026-02-02T15:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Workspace UI Action – Export Only Visible Form Fields to Excel</title>
      <link>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3479887#M1245843</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/861160"&gt;@dattanarend&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I doubt you get list of visible form fields in workspace&lt;/P&gt;
&lt;P&gt;So this requirement is not achievable based on my experience&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 15:41:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3479887#M1245843</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-02-02T15:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Workspace UI Action – Export Only Visible Form Fields to Excel</title>
      <link>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3480012#M1245865</link>
      <description>&lt;P&gt;REFINED REQUIREMENT: Custom Workspace UI Action – Export Only Visible Form Fields to Excel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STORY TITLE&lt;BR /&gt;As a Workspace User, I want to export only the visible form fields to Excel so that I can share relevant record data without including hidden or unnecessary information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SHORT DESCRIPTION&lt;BR /&gt;Create a UI Action button in Custom Workspace that exports the currently displayed form fields and their values to an Excel file, excluding any hidden or non-rendered fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DETAILED DESCRIPTION&lt;BR /&gt;Business Context and Value&lt;BR /&gt;Workspace users need to export record data for reporting, sharing with stakeholders, or offline analysis. Currently, standard export options either export all fields or require manual configuration. This creates inefficiency when users only need the specific fields visible on their current form view.&lt;BR /&gt;Current State&lt;BR /&gt;Users must either export all record fields (including irrelevant data) or manually copy field values from the form. There is no dynamic export option that respects the current form layout in Workspace.&lt;BR /&gt;Desired State&lt;BR /&gt;A single-click "Export to Excel" button that intelligently captures only the fields rendered on the current Workspace form and exports them with proper labels and values.&lt;BR /&gt;User Journey&lt;/P&gt;&lt;P&gt;User opens a record in Custom Workspace&lt;BR /&gt;User reviews the form (which may have conditional field visibility)&lt;BR /&gt;User clicks "Export to Excel" UI Action&lt;BR /&gt;System identifies all currently visible form fields&lt;BR /&gt;System generates Excel file with field labels and corresponding values&lt;BR /&gt;User downloads the Excel file&lt;/P&gt;&lt;P&gt;Success Metrics&lt;BR /&gt;• Reduction in time spent manually extracting form data by 80%• User adoption rate of 70% within first quarter• Zero incidents of sensitive hidden field data being inadvertently exported&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ACCEPTANCE CRITERIA&lt;BR /&gt;Scenario 1: Basic Export Functionality&lt;BR /&gt;Given: A user has a record open in Custom Workspace with 10 visible form fieldsWhen: The user clicks the "Export to Excel" UI Action buttonThen: An Excel file downloads containing exactly those 10 fields with labels in Column A and values in Column B&lt;BR /&gt;Scenario 2: Conditional Field Visibility Respected&lt;BR /&gt;Given: A form has Field X configured to show only when Field Y equals "Active"And: Field Y currently equals "Inactive" (so Field X is hidden)When: The user clicks "Export to Excel"Then: Field X is NOT included in the exported Excel file&lt;BR /&gt;Scenario 3: Reference Field Handling&lt;BR /&gt;Given: A form contains a reference field (for example, Assigned To)When: The user clicks "Export to Excel"Then: The Excel displays the display value (for example, "John Smith") not the sys_id&lt;BR /&gt;Scenario 4: Field Label Accuracy&lt;BR /&gt;Given: A form field has a custom label configured in the form layoutWhen: The user clicks "Export to Excel"Then: The Excel uses the custom label, not the dictionary field label&lt;BR /&gt;Scenario 5: Empty Field Handling&lt;BR /&gt;Given: A visible form field has no value (empty or null)When: The user clicks "Export to Excel"Then: The field appears in Excel with an empty value cell (field is not omitted)&lt;BR /&gt;Scenario 6: Date and Time Field Formatting&lt;BR /&gt;Given: A form contains date/time fieldsWhen: The user clicks "Export to Excel"Then: Dates export in user's preferred format as configured in their profile&lt;BR /&gt;Scenario 7: Error Handling - No Visible Fields&lt;BR /&gt;Given: An edge case where no form fields are visibleWhen: The user clicks "Export to Excel"Then: A user-friendly message displays: "No fields available to export"&lt;BR /&gt;Scenario 8: Large Form Performance&lt;BR /&gt;Given: A form with 50 or more visible fieldsWhen: The user clicks "Export to Excel"Then: The export completes within 5 seconds&lt;BR /&gt;Scenario 9: UI Action Visibility&lt;BR /&gt;Given: A user without export permissions (if ACL restricted)When: The user views the formThen: The "Export to Excel" button is not visible&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TECHNICAL REQUIREMENTS&lt;BR /&gt;Platform Requirements&lt;BR /&gt;• ServiceNow Platform Version: Tokyo or higher (Workspace UI Actions supported)• Browser Compatibility: Chrome (latest), Edge (latest), Firefox (latest)• Custom Workspace must be built using UI Builder&lt;BR /&gt;Architecture Approach&lt;BR /&gt;Since there is no OOTB method to retrieve visible form fields from a Workspace form during UI Action execution, the recommended approach involves:&lt;BR /&gt;Option A: Client-Side Field Detection (Recommended)&lt;BR /&gt;1. UI Action triggers client-side script in Workspace&lt;BR /&gt;2. Client script queries the DOM or uses Workspace APIs to identify rendered field elements&lt;BR /&gt;3. Field names are collected and passed to a Script Include via GlideAjax&lt;BR /&gt;4. Server-side script retrieves field values and generates Excel&lt;BR /&gt;5. Excel file is returned to client for download&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Option B: Form Configuration Metadata Approach&lt;/P&gt;&lt;P&gt;Store form field configuration in a custom table or system property&lt;BR /&gt;UI Action reads the configuration to determine expected visible fields&lt;BR /&gt;Server-side generates Excel based on configuration&lt;BR /&gt;Limitation: Does not account for runtime conditional visibility&lt;/P&gt;&lt;P&gt;Option C: Hybrid Approach (Best Practice)&lt;/P&gt;&lt;P&gt;Use Workspace declarative actions to capture form context&lt;BR /&gt;Leverage Now Experience UI Framework APIs (if available) to get rendered components&lt;BR /&gt;Pass field list to server for processing&lt;BR /&gt;Generate Excel using ExcelJS or similar library&lt;/P&gt;&lt;P&gt;Integration Points&lt;BR /&gt;• UI Builder Form Component APIs&lt;BR /&gt;• GlideRecord for data retrieval&lt;BR /&gt;• GlideAjax for client-server communication&lt;BR /&gt;• Attachment API or direct download mechanism for file delivery&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Performance Requirements&lt;BR /&gt;• Field detection must complete within 2 seconds• Excel generation must complete within 3 seconds• Total export time must not exceed 5 seconds for forms with up to 100 fields&lt;BR /&gt;Security Considerations&lt;BR /&gt;• Respect existing field-level ACLs (user should not export fields they cannot read)• Validate field list server-side to prevent injection attacks• Audit log each export action with user, record, timestamp, and field count• Ensure exported file does not contain sys_ids for sensitive reference fields unless required&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DEPENDENCIES&lt;BR /&gt;Upstream Dependencies (What This Needs)&lt;BR /&gt;• Custom Workspace must be deployed and functional• Form layouts must be configured in UI Builder• User must have read access to the target table• Excel generation library or method must be available (for example, ExcelJS, GlideSysAttachment)&lt;BR /&gt;Downstream Dependencies (What Needs This)&lt;BR /&gt;• None identified; this is a self-contained feature&lt;BR /&gt;External System Dependencies&lt;BR /&gt;• None; Excel generation is handled within ServiceNow&lt;BR /&gt;Data Dependencies&lt;BR /&gt;• Real-time access to the record being viewed• Access to form field metadata (labels, types)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ASSUMPTIONS&lt;BR /&gt;Business Assumptions&lt;BR /&gt;• Users have legitimate business need to export visible form data• Export frequency will be moderate (not bulk/mass exports)• Single record export is sufficient (multi-record export not required)&lt;BR /&gt;Technical Assumptions&lt;BR /&gt;• UI Builder Workspace provides some mechanism to access rendered form components (via DOM, API, or event)• The Now Experience framework allows client scripts to execute from UI Actions• Excel file generation can be performed server-side without third-party integrations&lt;BR /&gt;Resource Assumptions&lt;BR /&gt;• Development team has experience with UI Builder and Workspace customization• Testing environment mirrors production Workspace configuration&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RISKS&lt;BR /&gt;Risk 1: No Native API for Visible Field Detection&lt;BR /&gt;Likelihood: HighImpact: HighDescription: ServiceNow may not provide an API to programmatically retrieve currently rendered form fields in WorkspaceMitigation: Implement DOM inspection as fallback; engage ServiceNow support for guidance; consider form configuration metadata approach&lt;BR /&gt;Risk 2: Performance Degradation with Large Forms&lt;BR /&gt;Likelihood: MediumImpact: MediumDescription: Forms with many fields or complex conditional logic may slow exportMitigation: Implement field count limits; add loading indicator; optimize queries&lt;BR /&gt;Risk 3: Workspace Version Compatibility&lt;BR /&gt;Likelihood: MediumImpact: HighDescription: Future Workspace updates may change how forms are rendered, breaking field detectionMitigation: Abstract field detection logic into maintainable component; document dependencies; include in regression testing&lt;BR /&gt;Risk 4: Security Exposure&lt;BR /&gt;Likelihood: LowImpact: HighDescription: Export mechanism could potentially expose fields user shouldn't seeMitigation: Server-side ACL validation for every field before including in export&lt;BR /&gt;Risk 5: Browser Compatibility Issues&lt;BR /&gt;Likelihood: LowImpact: MediumDescription: Excel download mechanism may behave differently across browsersMitigation: Test across all supported browsers; use standard download approaches&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OUT OF SCOPE&lt;BR /&gt;• Exporting multiple records at once (bulk export)• Exporting to formats other than Excel (for example, PDF, CSV)• Customizing Excel formatting (colors, fonts, column widths)• Exporting related list data• Exporting form attachments• Scheduling automated exports• Exporting from Classic UI or Service Portal (Workspace only)• Creating email functionality with export attached&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DEFINITION OF DONE&lt;BR /&gt;Development Complete&lt;BR /&gt;• UI Action created and configured for Custom Workspace• Client-side script implemented for visible field detection• Server-side Script Include created for Excel generation• Download mechanism implemented and functional&lt;BR /&gt;Testing Complete&lt;BR /&gt;• Unit tests cover all acceptance criteria scenarios• Integration testing completed in DEV environment• User Acceptance Testing (UAT) passed with sign-off• Performance testing validates 5-second requirement• Security review completed (ACL validation confirmed)• Cross-browser testing completed&lt;BR /&gt;Documentation Complete&lt;BR /&gt;• Technical documentation for maintenance team• User guide or knowledge article for end users• Release notes prepared&lt;BR /&gt;Deployment Ready&lt;BR /&gt;• Code reviewed and approved by peer• Update set or application scope ready for promotion• Rollback plan documented&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;QUESTIONS REQUIRING CLARIFICATION&lt;BR /&gt;Before development begins, please confirm the following:&lt;/P&gt;&lt;P&gt;Target Table(s): Which specific table(s) in Custom Workspace require this export functionality? Or should this work across all Workspace forms?&lt;/P&gt;&lt;P&gt;User Permissions: Should export capability be restricted to specific roles? If yes, which roles?&lt;/P&gt;&lt;P&gt;Audit Requirements: Is there a requirement to log/audit each export action for compliance?&lt;/P&gt;&lt;P&gt;Excel File Naming Convention: What should the exported file be named? (for example, TableName_RecordNumber_Timestamp.xlsx)&lt;/P&gt;&lt;P&gt;Reference Field Depth: For reference fields, should we export just the display value, or include additional details (for example, email for user references)?&lt;/P&gt;&lt;P&gt;Journal/History Fields: Should journal fields (for example, work notes, comments) be included if visible? If yes, how should multiple entries be formatted?&lt;/P&gt;&lt;P&gt;Attachment Handling: If an attachment field is visible, should the Excel include the attachment name, or is this out of scope?&lt;/P&gt;&lt;P&gt;Localization: Should field labels be exported in the user's language preference?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TECHNICAL INVESTIGATION NOTES&lt;BR /&gt;Regarding OOTB Capability:&lt;BR /&gt;Based on current ServiceNow documentation, there is NO out-of-the-box method to programmatically retrieve the list of visible form fields during UI Action execution in Workspace. The recommended approaches are:&lt;BR /&gt;Approach 1: DOM Inspection (Most Dynamic)&lt;BR /&gt;Use client-side JavaScript to inspect the rendered form and extract field names from data attributes on form elements.&lt;BR /&gt;Pros: Accurately reflects runtime visibilityCons: Fragile if DOM structure changes; requires careful selector management&lt;BR /&gt;Approach 2: Workspace Declarative Actions with Payload&lt;BR /&gt;Configure the declarative action to pass form context. Limited by what Workspace exposes in the action payload.&lt;BR /&gt;Pros: Supported approach using framework capabilitiesCons: May not include all needed field metadata&lt;BR /&gt;Approach 3: Form Section/View Configuration Query&lt;BR /&gt;Query sys_ui_section and sys_ui_element for the form view being used.&lt;BR /&gt;Pros: Server-side approach; stableCons: Does not account for UI Policy or Client Script conditional visibility&lt;BR /&gt;Recommended Best Practice:&lt;BR /&gt;Implement a hybrid solution combining DOM inspection for accuracy with server-side validation for security. Encapsulate the logic in reusable components that can be updated if ServiceNow provides better APIs in future releases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RELATED DOCUMENTATION REFERENCES&lt;BR /&gt;• ServiceNow Docs: UI Actions for Workspace&lt;BR /&gt;• ServiceNow Docs: Now Experience UI Framework&lt;BR /&gt;• ServiceNow Docs: GlideAjax&lt;BR /&gt;• ServiceNow Community: Workspace Customization Best Practices&lt;BR /&gt;• ServiceNow Developer Blog: Working with UI Builder Forms&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I captured your requirements correctly?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 18:41:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3480012#M1245865</guid>
      <dc:creator>KingC</dc:creator>
      <dc:date>2026-02-02T18:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Workspace UI Action – Export Only Visible Form Fields to Excel</title>
      <link>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3480015#M1245866</link>
      <description>&lt;P&gt;Regarding OOTB Capability:&lt;BR /&gt;Based on current ServiceNow documentation, there is NO out-of-the-box method to programmatically retrieve the list of visible form fields during UI Action execution in Workspace. The recommended approaches are:&lt;BR /&gt;Approach 1: DOM Inspection (Most Dynamic)&lt;BR /&gt;Use client-side JavaScript to inspect the rendered form and extract field names from data attributes on form elements.&lt;BR /&gt;Pros: Accurately reflects runtime visibilityCons: Fragile if DOM structure changes; requires careful selector management&lt;BR /&gt;Approach 2: Workspace Declarative Actions with Payload&lt;BR /&gt;Configure the declarative action to pass form context. Limited by what Workspace exposes in the action payload.&lt;BR /&gt;Pros: Supported approach using framework capabilitiesCons: May not include all needed field metadata&lt;BR /&gt;Approach 3: Form Section/View Configuration Query&lt;BR /&gt;Query sys_ui_section and sys_ui_element for the form view being used.&lt;BR /&gt;Pros: Server-side approach; stableCons: Does not account for UI Policy or Client Script conditional visibility&lt;BR /&gt;Recommended Best Practice:&lt;BR /&gt;Implement a hybrid solution combining DOM inspection for accuracy with server-side validation for security. Encapsulate the logic in reusable components that can be updated if ServiceNow provides better APIs in future releases.&lt;/P&gt;&lt;P&gt;RELATED DOCUMENTATION REFERENCES&lt;BR /&gt;• ServiceNow Docs: UI Actions for Workspace&lt;BR /&gt;• ServiceNow Docs: Now Experience UI Framework&lt;BR /&gt;• ServiceNow Docs: GlideAjax&lt;BR /&gt;• ServiceNow Community: Workspace Customization Best Practices&lt;BR /&gt;• ServiceNow Developer Blog: Working with UI Builder Forms&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 18:46:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3480015#M1245866</guid>
      <dc:creator>KingC</dc:creator>
      <dc:date>2026-02-02T18:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Workspace UI Action – Export Only Visible Form Fields to Excel</title>
      <link>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3480237#M1245896</link>
      <description>&lt;P&gt;Glideform has at least these two methods in workspaces to check if a field is visible: isVisible and isFieldVisible. I recall isVisible gives false negatives (at least on classic ui) if the visibility is toggled by setting a non-visible empty field as mandatory vs explicitly setting display as true.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const gform = querySelectorShadowDom.querySelectorAllDeep('sn-form-data-connected')[0]?.nowRecordFormBlob?.gForm //use g_form when calling from client script
gform.setDisplay("description", true)
console.log(gform.getFieldNames().filter(n =&amp;gt; gform.isVisible(n)))
gform.setDisplay("description", false)
console.log(gform.getFieldNames().filter(n =&amp;gt; gform.isFieldVisible(n)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;as above:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lauri457_0-1770091100988.png" style="width: 708px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/499288i16DA6749020BB24C/image-dimensions/708x188?v=v2" width="708" height="188" role="button" title="lauri457_0-1770091100988.png" alt="lauri457_0-1770091100988.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2026 04:05:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3480237#M1245896</guid>
      <dc:creator>lauri457</dc:creator>
      <dc:date>2026-02-03T04:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Workspace UI Action – Export Only Visible Form Fields to Excel</title>
      <link>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3481810#M1246135</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/861160"&gt;@dattanarend&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In Workspace, actions like Export to Excel are not handled purely through classic UI Actions. They are typically configured and controlled through UI Builder, where the form and its actions are rendered.&lt;/P&gt;&lt;P&gt;Currently, there is no out-of-the-box way to retrieve the list of only visible form fields from a Workspace form during UI Action execution. Server-side scripts do not have direct awareness of the UI Builder form’s visibility state.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The recommended best-practice approach is to:&lt;/P&gt;&lt;P&gt;Identify or track the visible fields on the client side (UI Builder / form component)&lt;/P&gt;&lt;P&gt;Pass the list of visible field names to the server (via an action, data broker, or Script Include)&lt;/P&gt;&lt;P&gt;Generate the Excel file dynamically on the server using only those fields, including field labels and record data&lt;/P&gt;&lt;P&gt;This approach aligns with Workspace design patterns, avoids hardcoding fields, and supports dynamic layouts. In more advanced cases, the button action may be wired to client logic, actions or data brokers, and Script Includes, all managed through UI Builder.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you find this response helpful, please mark it as Helpful and accept it as the solution if it addresses your question—it would encourage me to contribute more to the ServiceNow Community.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;BR /&gt;Sachin Narayanasamy&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 16:48:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/custom-workspace-ui-action-export-only-visible-form-fields-to/m-p/3481810#M1246135</guid>
      <dc:creator>Sachin_Nasa</dc:creator>
      <dc:date>2026-02-04T16:48:56Z</dc:date>
    </item>
  </channel>
</rss>

