Stephen Gilmore

How to check file sizes in Workday Studio

Jan. 14, 2025 #Workday #Workday Integrations #Workday Studio

Recently I was looking at a Studio integration that was throwing errors for trying to occasionally send files out to a vendor that were too large (>10mb). So I was curious if I could read the file size in Workday Studio and then choose to make the API request without the file when the file was too large for the vendor to accept.

Solution

Turns out this is fairly easy to accomplish. Say that the current message in the integration is the file contents. Simply use the MVEL expression parts[0].text.bytes.length to get an integer value for the size of the file in bytes.

Example

I created a text document on my computer of ~10mb. I then base64 encoded the file and saved it as large_file_base64.txt. The original file shows as 10,485,760 bytes on my computer. The base64 encoded file shows as 13,981,016 bytes.

Then I created a quick Studio integration to test my file.

Studio Integration Screenshot

And the messages match the file system file sizes!

Decoded file bytes: 10485760

Base64 file bytes: 13981016