cancel
Showing results for 
Search instead for 
Did you mean: 
kapilkjoshi
Nintex Newbie

Attachments from NWC form

Jump to solution

I would like to know how can I retrieve the attachments from the NWC start up form and attach them to the item in SharePoint list.

I'm using OneDrive as storage location. The collection of the attachments looks like this:

["{\"path\":\"/WorkflowFiles/a4319896-9b5d-4326-8b65-35570a217bb6/GetAllSiteColl.txt\",\"connectionId\":\"492723\"}", "{\"path\":\"/WorkflowFiles/a4319896-9b5d-4326-8b65-35570a217bb6/INintexDetails.txt\",\"connectionId\":\"492723\"}"]

I have tried looping through the Attachment collection variable, but it doesn't retrieve the file. I know the path where the files will get stored, but i need to know the names of the files to attach them to item in sharepoint list.

Only way i have been able to get the name of the files is with these steps:

  1. Get folder Content - from OneDrive get all the file names in collection variable)
  2. Sort Items in Collection - descending so if there is any signature file, it gets the index=0.
  3. Remove item from collection - at index 0, this removed the signature file from collection.
  4. loop through the collection of folder content received in step 1

This gives me the file names and i can then create a loop to add items to SharePoint list item. Is there any better way to perform these steps?

Thank you.

Labels: (2)
0 Kudos
Reply
4 Replies
gonzalo_marcos
Nintex Newbie

Re: Attachments from NWC form

Jump to solution

Hi Kapil,

Attachments in NWC forms are stored in a Collection variable. To get the files within that collection you need to Loop For Each element of that collection and store the item of the iteration in a File Variable. Make sure the Store Item variable is of the type File. And then, the action you need inside the loop is the Add attachment to an item SP action that uses the file variable in the loop. Screenshots attached. Hope it helps.

        

Reply
mikeboggs23
Nintex Newbie

Re: Attachments from NWC form

Jump to solution

This was very helpful, but I have a follow up question.

 

What if I just want the file names of the attachments so I can build a string with a list of the attachments?  

0 Kudos
Reply
kapilkjoshi
Nintex Newbie

Re: Attachments from NWC form

Jump to solution

Hi @mikeboggs23 ,

As i suggested in my question, you can retrieve the names of the attachments from the collection variable. Once they are saved in the temp location, you can retreive the name using Get File metadata action > OneDrive for Business. Hope it helps.

Reply
mikeboggs23
Nintex Newbie

Re: Attachments from NWC form

Jump to solution
Yes, that is helpful. I'm not using OneDrive (Should have been more clear), but I am storing each attachment in Box. I should be able to use the get metadata action for Box to get the title and I never would have thought of that without your help. Thank you.
0 Kudos
Reply