How to add new column in CSV/Excel file in attachment ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2025 05:22 AM
There are some csv files contains 10k rows are supposed to add manually to the record, but for later operation we have to add one more column to the csv file.
Is there a way that we can get the file from attachment table and add one more column with header and values and add to the records attachment again .
Appreciate the responses.....!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2025 05:28 AM
you can use CSVParser API and try to manipulate that csv, add new column and then add data to that column for those rows
OR
Another way is to get file content of that CSV and then manipulate the column
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2025 08:14 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2025 01:57 AM
Hello @Ankur Bawiskar ,
Thank you for your response.
I noticed that all the code snippets you shared via the link are focused on parsing values from glideSysAttachment. However, my requirement is to add a new column to the attachment CSV file, not just to read values from it.
Could you please clarify which specific line of code will help me add a new column to the CSV attachment?
Thank you for your assistance.
Thanks,
Chandan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2025 02:14 AM
since you said you already had csv files and wanted to add new column to it, that's why I shared the approach to parse and then add new column.
it's an easy requirement.
what did you start with and where are you stuck?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader