emha
Automation Master
Automation Master

Re: Copy list item from one site to another including attachements

Jump to solution

once again, you cannot supplie 'base64Binary' or 'FileData' literally as these string.

they are just a placeholders for real file content. and the file content has to be base64 encoded.

 

as you mentioned, a possible way how to get list item's attachment base64 encoded is described on Vadim's blog

http://www.vadimtabakman.com/nintex-workflow-get-list-item-attachment-in-base64-custom-action-happy-...

0 Kudos
Reply
mai-kel
Design Canvas Artiste

Re: Copy list item from one site to another including attachements

Jump to solution
Yeah, but the links are not working... 😞
0 Kudos
Reply
emha
Automation Master
Automation Master

Re: Copy list item from one site to another including attachements

Jump to solution

which one?

0 Kudos
Reply
mai-kel
Design Canvas Artiste

Re: Copy list item from one site to another including attachements

Jump to solution

12-06-_2019_10-55-50.png

0 Kudos
Reply
emha
Automation Master
Automation Master

Re: Copy list item from one site to another including attachements

Jump to solution

none of these two links are important in your context.

 

anyway, nintex workflow SDK has been moved to the help portal https://help.nintex.com/Content/helpportal.htm

 

MS KB article showed just a sample C code how to get listitem attachemnts

https://web.archive.org/web/20150304172150/http://support.microsoft.com/kb/929259

0 Kudos
Reply
mai-kel
Design Canvas Artiste

Re: Copy list item from one site to another including attachements

Jump to solution
So, can you tell me how do I get the base64 encoded file content?! I am not familiar with C....
0 Kudos
Reply
emha
Automation Master
Automation Master

Re: Copy list item from one site to another including attachements

Jump to solution

have you read through Vadim's blog???

 

you do not need any coding.

simply download his GetListItemAttachemnt action suitable for your environment, ask your admins to install it, and then you can use it just like any other workflow action.

 

0 Kudos
Reply
mai-kel
Design Canvas Artiste

Re: Copy list item from one site to another including attachements

Jump to solution

OK all,

 

I finally managed to copy a list entry from one site collection to another site collection including attachements. As it took me quite a while and I am happy with the solution I want to share this with you.

 

As a prerequisite you need to build two identical lists. One in the site collection A, second in site collection B.

Another prerequisite is to setup a document library on both site collections, I named them both "FeedbackAttachments".

 

Now we can build the first workflow (running on the list) of two workflows (the other one is running on the attachment folder):

13-06-_2019_13-01-11.png

1. Create element in another website (here we copy all the columns from one list to another):

13-06-_2019_13-08-16.png

13-06-_2019_13-11-12.png

2. Commit pendig changes (always a good idea after updating a list!)

3. Copy to SharePoint (here we copy the attachment to the prepared folder)

13-06-_2019_13-16-20.png

4. Regular Expression

13-06-_2019_13-19-08.png

 

5. For each

13-06-_2019_13-20-53.png

6. Query list

13-06-_2019_13-26-35.png

 7. Update multiple items

13-06-_2019_13-28-27.png

8. Commit pendig changes (always a good idea after updating a list!)

9. Call web service

13-06-_2019_13-34-59.png

That's all for this workflow. Now go to the folder you've created and create a new workflow:

13-06-_2019_13-37-46.png

1. Call web service

13-06-_2019_13-39-19.png

Web service message:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/sharepoint/soap/">
<soap:Header>
</soap:Header>
<soap:Body>
<m:AddAttachment>
<m:listName>FeedbackmanagementNeu</m:listName>
<m:listItemID>{ItemProperty:Title}</m:listItemID>
<m:fileName>{ItemProperty:FileLeafRef}</m:fileName>
<m:attachment>[FileData]</m:attachment>
</m:AddAttachment>
</soap:Body>
</soap:Envelope>

 

2. Delete item

13-06-_2019_13-40-44.png

BTW: as this workflow is only started be the web service call from our first workflow you can keep the settings here as follows:

 

13-06-_2019_13-42-17.png

 

That's it. Enjoy!

 

Cheers

mai-kel

View solution in original post

Reply
mai-kel
Design Canvas Artiste

Re: Copy list item from one site to another including attachements

Jump to solution

@emha :

1. I was not able to use a WSP on customer system, but with this, it also worked

2. Luckily this "wording" does the job: <m:attachment>[FileData]</m:attachment>

Reply
vadim_tabakman
Nintex Employee
Nintex Employee

Re: Copy list item from one site to another including attachements

Jump to solution
Mai-Kel, this is the perfect solution for this, without having to do any coding or any custom actions, like the one I built. Great job getting to the bottom of this and getting this work. Very nice solution!!
Reply