Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Possible to add date created for attachments in CSM/FSM Configurable Workspace?

maryellc
Tera Expert

Our users would like the date (added) to be displayed on the attachment on a case in the CSM/FSM Configurable workspace.

 

We know there is a solution to add it to the UI (https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1343190), but our users' business process is to work from the CSM/FSM Configurable workspace.

 

A prior implementation partner told us this:  "Workspace components are part of a secured application within ServiceNow that cannot be edited or easily be swapped to another component.  This would be a rather large scale configuration, as this would be changing platform functionality itself."

 

Is there no solution for the workspace that wouldn't go against this (understood) 'no-no' change to platform functionality?

1 REPLY 1

thullurishalini
Kilo Guru

Hi @maryellc 

To display the date created for attachments in the CSM/FSM Configurable Workspace without making extensive changes to platform functionality, you can use a UI Component Extension. Here’s a high-level approach:

  1. Create a Custom UI Component:

    • Develop a custom UI component that fetches and displays attachment details, including the date created.
    • Use the sp-attachment component as a reference and extend it to include the date created.
  2. Embed the Custom Component:

    • Embed this custom component within the Configurable Workspace using the UI Builder.
    • Ensure it replaces or supplements the existing attachment display functionality.
  3. Use GlideRecord to Fetch Attachment Details:

    • In your custom component, use GlideRecord to fetch attachment details, including the date created.
    • Display these details in the desired format.

Example Code Snippet:

// Example of fetching attachment details
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_sys_id', current.sys_id);
gr.query();
while (gr.next()) {
    var attachmentDetails = {
        name: gr.file_name,
        dateCreated: gr.sys_created_on.getDisplayValue()
    };
    // Add logic to display these details in your custom component
}