I have a very simple script in my workflow to grab the size of all documents in a folder to make sure that an email activity won't fail later:
protected override void Execute()
{
// Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
FolderStatistics attachmentsFolder = Folder.GetStatistics((int)GetTokenValue("FindEmailDeliveryFolder_OutputEntry_ID"), RASession);
long attachmentsFileSize = attachmentsFolder.TotalFileSize;
SetTokenValue("Attachment File Size", attachmentsFileSize);
}
But the problem is, it is assigning my attachmentsFileSize as a string to that token, which is making it difficult to evaluate because the comparison is alphabetical, not numeric. So files that are actually only 400,000 B are evaluating as more than 25,000,000 B, because 4 is greater than 2 alphabetically.
Is there a way to force that token to represent an integer, or a number? I expected that passing it a numeric data type would make it store the numeric value, but I guess not.