Forum Index

No notifications


No favorites found
General Training Discussion General chat and comment on KnowledgeKube training
Subscribe to post
User avatar
matt.pitman - (04/08/2016 10:32:05)
RE:Getting "UploadedFileName" in a Document Uploader
Hi Manny, Because of the way the Document Uploader question works, I'm afraid it's not as simple as adding the question to the parser and referencing it in an expression. As you probably know, there are a number of functions for interacting with files after they've been uploaded, the most fundamental of which being ListUploadedDocuments. This function produces a CSV list of files you've uploaded to session memory using a particular document uploader, including their filenames. If you have limited your uploader to accept a maximum of one file to session memory, the resulting CSV will look something like this:
If this list is then assigned to a variable named (for example) CSVUploadDetails, you can fetch the file name using an expression like the one below:
MyFileName:= CSVGetListItemByIndex(1,CSVUploadDetails,"","|",",");
In this expression, we've treated each item in the CSV as an individual row (by specifying a comma as the Row Separator instead of the usual List Separator). This lets us fetch the second 'row' by referring to the item with index 1 (since index 0 refers to the first item). The result of this expression is company_logo.jpg being assigned to the MyFileName variable. If your uploader is intended to commit more than one file at a time, you could expand this expression to isolate a single entry from the CSV before extracting the file name as described above. If this is the case, let me know if you need some guidance on doing this. I've been chatting to the development team today about this functionality, and there will be some new functions added in the near future to make this process a lot more straightforward. In the meantime, if you need to learn more about functions for working with CSV, you can find a full guide here. Kind regards.
RSS Feed