Bradley
Nintex Newbie

How to get the URL of a file Saved to OneDrive

Jump to solution

Hi everyone.

Here is an explanation of what I am trying to achieve using NWC and a form to start the workflow.

1) User uploads 1 file using the Form -> Submit
2) Save the file to OneDrive (This can be achieved)
3) Email the URL of the document in OneDrive to someone

 

I can't seem to find a way within NWC to retrieve the URL.
One of the solutions I tried was to extract the File Name of the attached file, but this also seems to be unachievable?

Thanks in advance 😉

0 Kudos
Reply
6 Replies
leighburke
Nintex Employee
Nintex Employee

Re: How to get the URL of a file Saved to OneDrive

Jump to solution

@Bradley You can use the copy file action(https://help.nintex.com/en-US/nwc/Content/Designer/Actions/OneDriveforBusiness-CopyaFile.htm) instead, that stores the file path. Alternatively you can be log the fileupload variable to the instance details and check the format of the variable data. This should then allow you to use a regular expression to extract filename out.

 

View solution in original post

Reply
Bradley
Nintex Newbie

Re: How to get the URL of a file Saved to OneDrive

Jump to solution

Thanks @leighburke , that was a great answer.
Unfortunately when testing the copy file action and using a File Variable as the source, I receive an error when executing. "source path or file variable required"

Bradley_0-1609884633876.png

Here is the configuration used.

Bradley_1-1609884699062.png

Is this possibly a bug? 

Thanks again!

 

0 Kudos
Reply
leighburke
Nintex Employee
Nintex Employee

Re: How to get the URL of a file Saved to OneDrive

Jump to solution

@Bradley  It should work I just tested and confirmed, is that the correct file variable? Otherwise I would check out the path field

0 Kudos
Reply
Bradley
Nintex Newbie

Re: How to get the URL of a file Saved to OneDrive

Jump to solution

Thanks @leighburke , your assistance helped me get to the end goal, which was to get a sharable Url to a document uploaded to OneDrive.

To summarize the actions used, for others who might be interested.

1) Using a form to upload a document

2) Used the "OneDrive - Copy a file" action, storing the "new path as a variable"

3) Used the "OneDrive - Share a file link" action using the path returned from the previous step, and storing the "download" or "view" link as a variable.

This returned a valid url to the document, which could then be shared via email.


 

0 Kudos
Reply
leighburke
Nintex Employee
Nintex Employee

Re: How to get the URL of a file Saved to OneDrive

Jump to solution

@Bradley Awesome, the other option would of been using the path from the copy action and a build string action to make a file url, but the sharing a file link is the best option.

0 Kudos
Reply
Bradley
Nintex Newbie

Re: How to get the URL of a file Saved to OneDrive

Jump to solution

@leighburke , I originally tried the approach of building a Url, however as I learned today, to share files stored on OneDrive, it is not possible via a Url such as [Base_Path]/Location/Document. OneDrive requires a shared link to be created, luckily the "Sharing file link" action exists.

Again thanks for your assistance!

0 Kudos
Reply