Working with the File data type in NWC

  • 13 April 2018
  • 6 replies
  • 13 views

Badge +3

I have a proof of concept I'm trying to work through with file processing.  We have a simple form for the start that includes a file upload, files are pushed to OneDrive as the default content storage location.  The form side of this works fine and the file is uploaded. 

On the workflow side I can grab the collection of files, and the individual file to take action on, but I cannot get any info about the file such as the file name.  Ideally, we would like to know what it is called, what type it is, and be able to reference it.  

Within the workflow design environment the variable with the type of File seems to have a very limited use so I'm unable to do much with it other than pass it on as it is.  It passes the content, but we have to assign a new name and hope its a compatible format.  

Any ideas?

Vadim Tabakman ‌ 


6 replies

Userlevel 7
Badge +17

OneDrive also has a Get File Metadata action that may help here. It will store the

  • filename
  • url
  • created date
  • last modified date
  • file size
Badge +3

Familiar with those actions.  The challenge here is that I have access to the file object/variable already, and I cannot re-load the item from OneDrive to take advantage of the other actions unless I can identify the item to load.  Since I don't have a name or referencing url, how do you know what file to load?

Userlevel 7
Badge +17

I see what you mean. Can you share how you received the file object?

Badge +3

The form has a file upload control.  The control provides the option to put a reference to the file object in a variable.  The variable is a collection, in this case called MyFiles.  

The workflow then works with the collection object and specifically leverages the "Get item from collection" action to fill a variable called currentfile which is of the File datatype.  

This all works great, but I don't seem to be able to do anything with the currentfile variable other than pass on the file to something else.  I cannot inspect it, read properties, get a url, etc.  

Userlevel 7
Badge +17

Ah, good notes. I can see where it should be simple enough to get the filename, but url should be lost once it is uploaded. I don't think there are any tricks like using JSON queries will get any additional info, but maybe there is more to finding that information other than saving it somewhere to retrieve it. You can save collections of files to sources as well.

Badge +3

In order to use the File Upload control you have to configure your default storage location which in this case is one drive.  Since we are using the OOTB control, we don't really seem to have any control or view into the upload process.  What you see in the screenshots appears to be all I have access to. 

Reply