Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


ErikC
  •  ErikC
  • Free support Topic Starter
2017-05-16T09:52:34Z
Hi,

Currently I try to upload a file to a Sharepoint 2013 custom list. The file is an attachment of the item.

What I do now is the following:
  1. Create a new list item with the 'Add list item' task.
  2. I retrieve the latest item added to the list using the Get list item(s) task and using a CAML query to retrieve the ID
  3. Finaly i want to add an attachment to the item by using the Upoad file(s) task.

The last action failes as there is no ID directory created when the item is added in step 1 without an attachment.

../Lists/[LISTNAME]/Attachments/[ID]

I get the error:
Exception in Task: System.Exception: Folder not found!
   at SharePointTasks.Core.Tasks.UploadDocumentTaskParams.UploadFile(String source, Boolean sharePointOnline)
   at SharePointTasks.Core.Tasks.UploadDocumentTaskParams.ExecuteCore()
   at SharePointTasks.Core.Tasks.BaseTaskParams.Execute()

Also I used in the Destination folder the variable {TASK(2,StdOut)} for the ID, but it is not parsing the variable in there.

It only works if I add an attachement to the list using Sharepoint (browser), than the ID folder is made in the attachment folder of the list.

So two things here:
  1. Make the destination folder work with variables in the Sharepoint Upload file(s) task
  2. When uploading a file to a Sharepoint list, create the directory if it isn't there.


Hope to see this in the near feature.

Regards,
Erik


Uses Visualcron since 2006.
Sponsor
Forum information
Support
2017-05-16T12:35:19Z
I just checked the code and the Destionation folder Variables are translated. Can you try any other Variable type like User Variable?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
  •  ErikC
  • Free support Topic Starter
2017-05-17T06:37:25Z
Originally Posted by: Support 

I just checked the code and the Destionation folder Variables are translated. Can you try any other Variable type like User Variable?


I checked the variable and tested it with a job variable and it worked. So parsing was ok.

Why did it fail in my setup?

The retrieval of the last added item in the list had a linebreak at the end. My CAML is:
<View><RowLimit>1</RowLimit><Query><OrderBy><FieldRef Name='ID' Ascending='False' /></OrderBy></Query></View>
In the Output tab, there is a dropdown to use NoLineBreak. This fixed the issue.

Quote:


So two things here:

  1. Make the destination folder work with variables in the Sharepoint Upload file(s) task WORKING
  2. When uploading a file to a Sharepoint list, create the directory if it isn't there.



Only the creation of a folder (path) if it's not there is left. Is there a way around this?

Regards,
Erik

Uses Visualcron since 2006.
ErikC
  •  ErikC
  • Free support Topic Starter
2017-06-06T07:26:59Z
Hi,

Any updates on this one? Creating a folder when it's not there?

[edit] Current beta 8.2.8 (2017 June 07) does not create missing folders in the file upload task. [/edit]

Regards,
Erik
Uses Visualcron since 2006.
Scroll to Top