tmfitz
Scholar

Attach a SharePoint Online List Item Attachment(s) to NWC Workflow Assign a Task or Send an Email

Jump to solution

I have a workflow with Start event: SharePoint - New List Item. The SharePoint online list item will have files attached to it. In the workflow, I am trying to "Assign a task" to a particular person which sends an email that includes the file attached to the item (if there is one). In my testing, I have found that the task email is not received but the I can see the task is created from NWC dashboard.

I proceeded to try another scenario of attaching the file using "Send an email." In this case, I received the following error message:

Unable to process the email attachment. File attachment variable must be a File or a Collection of files. [Error Code: IO.GenericActionExecute.ErrorResponse]

In both cases, I am using the Item Attachments variable from the Start event.

tmfitz_0-1668789003056.png

Any ideas? I've submitted a ticket to support but waiting on them to get back to me.

Labels: (1)
0 Kudos
2 Replies
Prineel_V3
Nintex Employee
Nintex Employee

Re: Attach a SharePoint Online List Item Attachment(s) to NWC Workflow Assign a Task or Send an Emai

Jump to solution

Hi,

You need to get the attachments names, then add the attachments to a collection variable:
Step 1:
Use the "Get attachment names" action, configure it and output an object

Prineel_V3_0-1668789958171.png

Step 2:
In your loop for each, add the attachment collection from your object:

Prineel_V3_1-1668790109885.png

Step 3:
Use a "Get item attachment by name" action and configure it. In the attachment name config, use the current item from your loop for each tab (this will get each attachment by its name and we will store it in a collection). The output is a type file SharePoint Online Variable (we will use this in the next step)

Prineel_V3_2-1668790233703.png

Step 4:
Use an "Add item to collection" action to add the attachment into the collection based on the index from the loop for each. You will need to create a Workflow collection variable to store the files (In this example, i called it Attachments Collection which is in the target collection config and output config):

Prineel_V3_3-1668790408730.png

The value is the output (the actual attachment) from the previous step.

Prineel_V3_4-1668790752710.png

Finally:
We can then use the collection variable that we created which will contain the attachments in both email and task actions:

Prineel_V3_5-1668791106773.png


Hope this helps

Let me know if I need to clarify anything.

tmfitz
Scholar

Re: Attach a SharePoint Online List Item Attachment(s) to NWC Workflow Assign a Task or Send an Emai

Jump to solution

Thank you so much! This works.

0 Kudos