cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

How can i delete a file within a documentset

I have a library with a documentset content type. In that content type I have set a default template (template.xlsx)

Every time a new documentset is created, template.xlsx is added.

Now I want to setup a workflow which will check a metadata field for the value Yes/No

If the value is "No" then the template.xlsx file needs to be removed

If the value is "Yes" then the workflow needs to end.

Does someone knows how I can remove the template.xlsx in the created documentset?

OR

Can I add the template.xlsx trough the workflow instead of the default template within the documentset content type?

Kind regards,

Kevin

Labels: (2)
0 Kudos
Reply
3 Replies
Automation Master
Automation Master

Re: How can i delete a file within a documentset

I believe you should be able to do both. I recall an example on adding the file to the document set. Let me see if I can track it down

0 Kudos
Reply
Automation Master
Automation Master

Re: How can i delete a file within a documentset

Let me provide a couple of options for your review. Some are form this post Re: Copy documents from Document Set to Folder

A possible REST version of a copy a file from folder to folder. Didn't test in a document set, but works for libraries

[Site Url]/_api/web/folders/GetByUrl('DocSetA')/Files/getbyurl('doc1.docx')/copyTo(strNewUrl='[siteurl]/DocSetB/folderB/doc2.docx',bOverWrite=true)

And I've used this option many times in the past.

Would using the Move Document method found in the author.dll be of use here? This way you can move the document and keep version history without moving the folder it is contained in. For more: Nintex Workflow - Move Documents and Preserve Version History - Vadim Tabakman

0 Kudos
Reply
Automation Master
Automation Master

Re: How can i delete a file within a documentset

For deletion, use the Delete Multiple Items action. This will allow you to use references to find the path of the Doc Set and then filter by filename.

0 Kudos
Reply