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

Add list item attachment using Nintex Workflow for Office 365

How do I add an attachment to a new list item using Nintex workflow?

I tried using Web Request action to "Put" in content on following URL:

{Workflow Context:Current site URL}Lists/​{Workflow Context:List Name}​/Attachments/{Current Item:ID}/MyAttachment.txt

I verified that it creates a URL similar to attachments that are added manually. However, the workflow action fails with HTTP code 409: The remote server returned an error: (409) Conflict.

After a lot of trial and error - what I figured out was - this action fails to create a subfolder for 'current item-ID' under 'Attachments' folder.

If I add an attachment to this item while creating it, the workflow would execute when updating the item and it would create an additional attachment. But if there are no attachments for the item then the web-request action would fail with HTTP 409.

I tried using 'Office 365 Upload File' action by putting following as folder path

Lists\{Workflow Context:List Name}‌\Attachments\{Current Item:ID}

But it didn't work either. Workflow gets suspended with message:

RequestorId: abaf47f2-1538-33c4-0000-000000000000. Details: ServiceNoResponse

Event Type:  Comment

Event Description: The request cannot be processed due to internal error.

How do I add/upload an attachment dynamically to a list item?

Labels: (1)
Reply
23 Replies
Community Manager Community Manager
Community Manager

Re: Add list item attachment using Nintex Workflow for Office 365

Is there a reason you are trying to add it to an item instead of using the form to attach it?  You could also upload it to a document library and associate it to the list item via the Document ID.  That may be the easier route.

Accept as Solution Reply
Not applicable

Re: Add list item attachment using Nintex Workflow for Office 365

We need to create a calendar invite (ics file) based on custom user input.

Since Nintex workflow doesn't provide feature of sending calendar invite, we have to write the ics file using a Web Request action.

We needed to design a form to enter meeting details. The form stores data in a list. It would be convenient to to keep the ics file in the same list as attachments for each item and send it along with email through workflow.

Hope that explains our need.

Thanks.

Prafulla

Accept as Solution Reply
Workflow Hero

Re: Add list item attachment using Nintex Workflow for Office 365

Just an information about the 409 HTTP status code.

I have had the same issue when I wanted to create a file in document Library. I found the response in the origin of this issue in that site: HTTP Status Codes. The clue was in "if versioning were being used and the entity being PUT included changes to a resource which conflict with those made by an earlier (third-party) request, the server might use the 409 response to indicate that it can't complete the request."

So, in my document library, I deactivated the document version history option (Library Settings > Versioning settings) and now the file is well created, with no conflict.

May be that can be useful for you too...

Accept as Solution Reply
Not applicable

Re: Add list item attachment using Nintex Workflow for Office 365

Did we get a resolution for this? I am attempting to copy the attachments from one list item to another. My research indicates that I need to first copy the attachments from the source list item to a temporary document library. I have successfully done this. Then, I need a workflow on the document library to call the AddAttachment method of Lists.asmx service. I've implemented this, but I'm getting a 400 Bad Request response when using the Web Request action. I have configured it to hit the Lists.asmx service, with the http://schemas.microsoft.com/sharepoint/soap/AddAttachment soap action and a body of: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><AddAttachment xmlns="http://schemas.microsoft.com/sharepoint/soap/"><listName>Contract Tasks</listName><listItemID>8</listItemID><fileName>test.txt</fileName><attachment>[FileData]</attachment></AddAttachment></soap:Body></soap:Envelope>

Does the [FileData] token not work in Office 365? Is there a different way for me to accomplish adding an attachment to a list item from a document in a document library?

Accept as Solution Reply
Workflow Hero

Re: Add list item attachment using Nintex Workflow for Office 365

Same overhere Josh, tried also but no success...

Greets,

Peter

Accept as Solution Reply
Workflow Hero

Re: Add list item attachment using Nintex Workflow for Office 365

Hi! Just pinging to find out whether you found a solution or still looking for it? If yes (if you found) - can you write here how you achieve that? 

 

Regards,

Tomasz

Accept as Solution Reply
Workflow Hero

Re: Add list item attachment using Nintex Workflow for Office 365

No solution found on my site.

Peter

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Add list item attachment using Nintex Workflow for Office 365

Anyone maybe got it working in the meantime?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Add list item attachment using Nintex Workflow for Office 365

So let me get that straight: to be able to upload a file, and to make it an item's attachment, you need to:

  1. Know item's ID, and knowing it create a subfolder with that ID as name under https://<your-site-url/lists/<your-list>/Attachments/
  2. Upload a file to the location: https://<your-site-url/lists/<your-list>/Attachments/<item-ID>/

This is not working for you?

Regards,

Tomasz

0 Kudos
Accept as Solution Reply