I'm currently struggling to add attachments to a From using Nintex Workflow.
There is a Nintex form with 'Attachments' field in it.
The user is given various options as in what attachment does he wants to add (using tick boxes).
(The corresponding attachments are stored in a different SharePoint list)
Based on his choice, the attachments should be added to the from.
It can be achieved using the 'Call Web Service' action, and further choosing Web Method as AddAttachment in 'On-Prem' but I'm struggling to achieve in 365.
Need help please.
You need to use SharePoint REST API.
Take a look at this discussion:
In this scénario, the attachment of a task is uploaded as attachment of an item. This is similar to what you want to do (only the URL of the source document changes).
There are two important things
- if there has never been an attachment on the item, you need to ensure that the Attachment folder of your item exist, to do that, simply créate an empty attachment file by using
[SiteURL]/_api/web/lists/GetByTitle('[List Title]')/items([Item ID])/AttachmentFiles/add(FileName='dummy.txt')
- Upload your file as attachment of your item :
Use the follower REST API :
ps : Don't forget to remove your dummy file ;)