Worknotes need to support tabular format?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 06:54 AM
Hi Everyone,
I have one requirement from client work notes needs to be support tabular format like as below.
SNO | Name | Emp no | percentage |
1 | Raj | 24 | 80 |
2 | san | 25 | 90 |
But as per out of the box functionalities it is supporting like this below.
Thanks,
Srinath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 07:07 AM
Hi @srinathgtrk ,
This thread should help you with your requirement: https://www.servicenow.com/community/developer-forum/want-work-notes-display-in-tabular-format/m-p/2...
You need to wrap your content in code blocks [code]..........[/code] in order to display a table into worknotes.
If my answer has helped with your question, please mark it as correct and helpful
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 11:17 AM
Hi @srinathgtrk ,
Hope you are doing great.
Please find below code to create a simple table structure within the work notes field for reference:
function addTableToWorkNotes() {
var tableName = "<table>";
// Add table headers
tableName += "<tr><th>Column 1</th><th>Column 2</th><th>Column 3</th></tr>";
// Add table rows and data
tableName += "<tr><td>Data 1</td><td>Data 2</td><td>Data 3</td></tr>";
tableName += "<tr><td>Data 4</td><td>Data 5</td><td>Data 6</td></tr>";
tableName += "</table>";
// Append the table to the existing work notes field
var currentWorkNotes = g_form.getValue('work_notes');
var updatedWorkNotes = currentWorkNotes + "<br>" + tableName;
// Set the updated work notes value
g_form.setValue('work_notes', updatedWorkNotes);
}
you can customize the table structure, column names, and data as per your specific requirements.
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 11:18 AM
Hi @srinathgtrk ,
You can also refer following link too for reference : Formatting within Journal fields using HTML & [code]
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 10:13 PM
Apart from this html format is there any other way for tabular format support?
Thanks,
Srinath.