I would like to display the file names from the upload element.
I try to do this with binding the the results of the file upload element to a collection.
However, this doesnt work because the results of the upload element are not a collection. They include the length and another item. See below.
How can I do this?
1 Like
Joyce
2
Hi @kevinwasie
For some reason I can’t test this right now but you might use no-code formulas like createArray
, removeByIndex
or omit
.
Or you could add an action to the workflow to change an array variable with the result from the previous action like I did here:
Thank you @Joyce …
Option 2 won’t work because I want to display these files before they are uploaded.
I’m having difficulty with the formulas. I’ve tried every combination that I can think of.
Is it possible that the object formulas don’t work on [object file]?
Even if I do values(item.data) it shows as just an object file still.
It appears that the files are stored in an object, with key/value pairs, initially, instead of an array?
So, I use createArray, but that then leaves me with an object that I cannot use the object formulas on.
Thanks for any help…
Kevin
Ah, I was able to access it in JS. But, not in NoCode.
In JS: “return context.item.data.name” to access file name.
It’s a file object, so anything here should work: File - Web APIs | MDN
1 Like
Joyce
5
Nicely done @kevinwasie!
Yes, it seems the explorer was not recognizing the File type properly. The team looked into it. The fix should be pushed to production this week.
2 Likes
Hi @kevinwasie, Are you able to check File Size before the upload.
I want to validate file size in Work Flow before its uploaded.
@Joyce Any ideas?
it would be good to add file size upload limit in Upload Component, unless i am missing it somewhere?
Joyce
7
Hi @achinlalit
You could get the size of the file like this:
And add a pass through condition so that, if it exceeds a certain size, you don’t go through with the workflow.
Here’s a short video explaining this a bit more.
Let me know if it helps. If not, I’ll record a more structured tutorial!
@Joyce Thanks a lot. This perfectly resolved my issue.
1 Like