Skip to main content
Nintex Community Menu Bar

move items to a new list? With attachments?

  • September 13, 2019
  • 1 reply
  • 99 views
  • Translate

Forum|alt.badge.img+6

I see a few topics discussed on the subject however, most are not O365 and they have very unique situations that I don't have.

 

My situation is very simple, I have users submitting a form to a list with attachments.  After everything hs been completed and approved I will trigger a workflow to run.  This part I got.  In this workflow I want to move the item plus attacments to a new list for archiving purposes.

 

I already call the web service for the attachments in a nother workflow to email the user, however, I have not figured out how to move the item to a new list nor attach the attachments to an item.  I can create a new item and fill it with the data but there are over 100 columns that I would rather not hand pick, is there a way to easily move an item?  I can do a copy to new then a delete on the old, this works as well.

Did this topic help you find an answer to your question?

1 reply

allan
Forum|alt.badge.img+9
  • Rookie
  • 177 replies
  • September 25, 2019

In fact, you can move attachments with REST calls, it is the same as moving a document.


The trick is that attachments of items are stored not in the item but on the list directly.
Let say I have list named "TEST", here's the attachment for the Item 2, you will find a hidden folder at the root of your list named "Attachments" and a subfolder with the ID of your item

/sites/Allan/Lists/TEST/Attachments/2/MyAttachedFile.txt
-->
{ServerRelativeUrl}/Lists/{List name}/Attachments/{Item ID}/{File name}

 

If you move your file at this location, it will be considered as an attachement of the second item.
There also a second trick: You cannot use "copyTo" (from SharePoint API) directly to the destination folder if the folder does not exist beforehand. You need to create a dummy file (with content) to the the hidden folder location, then delete it. Otherwise your workflow will crash on the "copyTo" REST action.
There's also a 3rd trick: the size of your request cannot exceede 400 chars, but there's a workaround.

Please a look at this post : https://community.nintex.com/t5/Nintex-for-Office-365/Copy-task-attachments-to-Master-Item-on-O365/m-p/101874#M11905

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings