- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 03:18 AM
Hi All,
I have a requirement. While submitting a catalog item, I am uploading a CSV file. I need to compress the CSV file in Flow Designer and then convert to base64.
How to compress the CSV file in Flow Designer?
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 03:51 AM
you can use Zip operation from flow, create the zip file and store it on RITM or some record
then you can get base64 encoded data of that file easily
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
05-26-2025 03:51 AM
you can use Zip operation from flow, create the zip file and store it on RITM or some record
then you can get base64 encoded data of that file easily
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
05-28-2025 11:12 PM
Hi @Ankur Bawiskar ,
I am able to Zip the file. I have add one attachment with 44KB and after zipping it, the Zip file is now 3KB. But if I unzip it, I am again the attachment with 44KB not the compressed zip attachment which is 3KB.
How can I get that 3KB file and then convert this 3KB file to base64.
Please help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 11:15 PM
your main file is 44KB, after zip it's 3KB -> till this point it's ok
If you unzip then again you will get the actual file which is 44KB -> this is also expected behavior
what's the concern?
Now that you have zip file and you have added it to some record, use this to get base64encoded data for it
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
05-28-2025 11:51 PM
Hi @Ankur Bawiskar ,
I have stored that zip file in a record and then used it to convert it to base64.
Now I tried to check after decoding whether the contents that I am converting are correct or not, it not showing me the correct result. I could see only the file name and rest other details.
This Zip folder contains my Zip file. I am passing this RITM details to convert to base64.
The zip file is inside the zip folder, but when I covert to base64, it doesnt show me correct data.
I think it is converting the Zip folder not the file inside it.
Thanks!