Vadim Tabakman

*** Announcement 7th April 2013 ***

Now available, a Nintex Workflow 2013 of this custom action, that will allow you to get your item attachments into Base64.

This is not backward compatible.  If you're moving from using this action in 2010 to 2013, I'd recommend you remove that action from the 2010 workflow before exporting the workflow and importing it to your 2013 environment.  Then you can add this action and reconfigure it.  Since it's only 4 fields, configuring it should take no time. 


I've been hunting around the SharePoint web services, trying to find a web method that will allow me to get the attachments in a list item. The Lists.asmx web service exposes a GetAttachmentCollection web method, but it only returns a collection of Urls that point to the attachments. Unfortunately, I haven't been able to get the data inside the attachments.

The reason I want the data, is because some web methods such as AddAttachment require a Base64 string to be passed to it.

So I decided to write my own Nintex Workflow Action, based on the information in the Nintex Workflow SDK.

Nintex Workflow SDK

No doubt, someone will send me a message and say "Hey... but you could have done it using this web service.". Oh well. This is a good learning experience.

If you are interested in the code to read an attachment, have a look at this site :
How to programmatically download attachments from list items in Windows SharePoint Services

Input

We need 3 pieces of information, in order to successfully read an attachment.
1. List name : location of the item that contains the attachment
2. Item ID : List Item ID of the item that contains the attachment
3. Attachment Url : Url to the attached file that we want to read

Output

The only output we want is a Base64 string. If you want to learn more about Base64 click here Base64 on Wikipedia

Action Configuration



Usage

In an example of how you would use this, I created a workflow that obtained the attachment Urls for the list item the workflow is running on, and then extracted the data of each attachment and add it to another list item.



The structure of this workflow is actually quite straightforward, as seen from the completely sequential set of actions.

First we use the Call Web Service action to get the list of Attachment Urls, using the SharePoint Lists web service and specifically the GetAttachmentCollection web method.

We then use the Query XML action, to extract the Urls and store them in a Collection variable. Now that we have each Url in the collection, we use the For Each action to loop through each attachment Url.

Once we have the Url, we use our new action to get the Base64 encoded data of the attachment, and then we use the Web Request action to add a new attachment to another List Item.

The Web Request action is discussed in a previous blog : Nintex Workflow - Web Request action 101

In essence, we are using the Web Request action to call the SharePoint Lists web service, and the AddAttachment web method, which we can't do with the Call Web Service action.

My initial list item had 3 attachments. 2 Text files and 1 Image (PNG) file. The result after running this workflow, is this list item :



I didn't go into too much work with creating the filename for the attachments, so they all have a text file extension.

Happy Thanksgiving

I thought given that it's Thanksgiving in the US (even though I'm an Aussie), I'll do the giving and you guys can do the thanking :)

Below is the link the SharePoint solution that deploys my VT Get List Item Attachment action that I have described in this blog. I don't recommend you use it a production environment, as I have done limited testing on this action. But it is something you could play with in a Q/A or Development type of environment. I didn't provide the source code, because it isn't pretty, and I don't want to spend too much time cleaning it up. It does what I want it to do, and I'm happy with it.


Installation

To install this solution, run the following command line :
stsadm -o addsolution -filename VTListItemGetAttachmentAction.wsp

You can then go into SharePoint Central Administration->Operations and click on Solution Management. Here you can deploy the solution.

This deploys into the following folder :
c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\NINTEXWORKFLOW\VadimsActions\VTListItemGetAttachmentAction

One of the files that gets deployed is the NWA (Nintex Workflow Action) file. You use this to add the action to Nintex Workflow via the NWAdmin.exe utility, located :
c:\Program Files (x86)\Nintex\Nintex Workflow 2007

The command line would be :
NWAdmin -o AddAction -nwaFile VTListItemGetAttachmentAction.nwa

You will probably need to perform an IISRESET, so that the new assembly gets loaded. Then, in Central Administration->Application Management, in the Nintex Workflow Management section click on Manage Allowed Actions. Here you should scroll down to the VT List Item Get Attachment action and enable it.

The action should now appear in the workflow designer.

NOTE : obviously, it'll be a little different with a 2010 and 2013 environment where you can use PowerShell to add and deploy the solution.

For the 2013, once it's deployed, activate the VTCustomActions feature for the web applications you want to use this action on. 

Posted by Vadim Tabakman Sunday, February 5, 2012 1:33:00 PM Categories: Base64 Call Web Service Custom Action Nintex Nintex Workflow Nintex Workflow SDK
Copyright Vadim Tabakman
Rate this Content 1 Votes

Comments

Wednesday, August 15, 2012 5:57:24 AM
Hakan

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

I cant select "textAttachmentURL" in the Workflow. Any idea why?

Thanks!

Wednesday, August 15, 2012 5:57:28 AM
Hakan

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

I cant select "textAttachmentURL" in the Workflow. Any idea why?

Thanks!

Wednesday, August 15, 2012 7:14:28 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Are you sure it's the correct variable type?

You need to make sure it's a Text variable.

Tuesday, April 30, 2013 2:12:54 AM
Franz Sunkler

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hello Vadim!

any solution for sharepoint 2010? as the action "2007" is not available in 2010!?

Thanks.

regards

Franz

Tuesday, April 30, 2013 11:07:44 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Franz,

I have been playing around with a 2010 version.  I haven't done a lot of testing on it, but am happy to send you the WSP if you want to play with it.

Shoot me an email to vadim at vadimtabakman dot com and I'll zip up a copy for you.

cheers,

Vadim

Wednesday, November 13, 2013 1:22:59 PM
A.L

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

In Nintex WF 2013 would this still be the best way of handling moving a list attachment or are there already available actions that would handle getting  a list attachment in Base64? I have been working with web services but they don't seem to work the same for list attachments like they do for document libraries

 

Thanks 

Tuesday, December 10, 2013 8:13:58 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hello,

I've been looking for a while now to get a list item attachment in a Base64 string.
Until I found your solution. Probably you solution can help me (on a SP 2010).
But in the download files I don't find the  VTListItemGetAttachmentAction.nwa action file.
Is there any way to get it?

Best regards,

Mark

Tuesday, December 10, 2013 10:54:42 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Mark,

are you getting an error deploying the wsp solution?

The NWA should be part of the WSP, but you don't need to expand it, simply add it to the Central Admin > Solution Management and deploy it.

cheers,

vadim

Wednesday, December 11, 2013 3:55:55 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

I've added the solution and deployed the solution using Central Admin / Solution management. De WSP is globally deployed (by default) for the farm.
I did an IISRESET.
I don't see the extra action in the Nintex 2010 Allowed actions list (And when I check the site collection features or Site features I don't see an extra feature).
Maybe I did forget something, but I don't see what.
So that's why I thought I had to add the action manually to the list.

Best regards,
Mark 

 

 

 

Wednesday, December 11, 2013 10:07:58 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Mark,

I've updated the 2010 download.  Please download and reinstall it.

Then, in Central Admin, go to Manage Farm Features and activate the VTGetListItemAttachmentAction feature.  That will add the new action to Nintex Workflow and you won't need to do the NWAdmin stuff.

cheers,

Vadim

Thursday, December 12, 2013 6:29:12 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

Now the action appears. I had to activate the farm feature.
I can now use the action in my workflow.
But i'm quite a novice in this stuff. So I was happy with the sample workflow that I can download.
But when I import it into my workflows in Sharepoint I get an error (see italic).
I wonder if there is a way to get the details of the actions in this workflow. Evt. workflow without GetAttachment action, so I can look at what happens in the other actions. 

This workflow contains an action not available in this environment. Action title: 'VT List Item Get Attachment'. Action type: 'VTListItemGetAttachmentAction.Adapters.VTListItemGetAttachmentActionAdapter'. Action assembly: 'VTListItemGetAttachmentAction, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3d2b306284bf6cc6'

Best regards,
Mark

Thursday, December 12, 2013 7:46:37 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Mark,

I've uploaded a 2010 version of the workflow to see if that helps.

Also, I have the same workflow without the action here : Download

What I've done, is put a Log in the History List action where I would have the Get List Item Attachment action.  it has a label on the actions that says "This is where the Get List
Item Attachment Action would go!!!". This should give you an idea of what I was doing there.

I hope that helps.

cheers,

Vadim

Friday, December 13, 2013 2:17:58 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Thanks a lot!
I can now upload the workflow in 2010 and explore it.

Best regards,
mark

Thursday, February 13, 2014 6:07:37 PM
Matt

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

HI Vadim,

I am using your solution on a 2010 environment.  We deployed it yesterday and everything worked perfect.  I came in today and am now getting an error in the workflow whenever the custom action is being used.

Error performing database action. Object reference not set to an instance of an
object.

We have redeploying the solution, and reset IIS a few times, but this did not fix things.  Any ideas on why it might suddenly stop working?

Thursday, February 13, 2014 10:39:17 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Matt,

the only thing that comes to mind is that there's some issue accessing the file.

The "Error performing database action" sounds a bit odd, since the action doesn't touch any databases directly.  Are you using any Execute SQL actions in your workflow?  Is it possible that is failing?

Can you try a new workflow and get it to use this action and configure it the same way and see if that works or fails?

cheers,

Vadim

Friday, February 14, 2014 9:44:04 AM
Matt

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

thanks for the quick response.  Unfortunately that doesn't fix the issue. I rebuilt the entire workflow from scratch and it still had an error occur.  I've even rebuilt in different sites to see if that might be a cause, and the workflow fails on the custom action.

Friday, February 14, 2014 10:26:10 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Matt,

is there an error in the SharePoint logs?  It might point to where exactly in the action it's failing and I can take a look at the code.

Vadim

Friday, February 14, 2014 3:00:22 PM
Matt

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Here is the logs,

Verbose               Successfully persisted workflow instance: 555acadf-072b-4727-a6e7-b5b484b8ee64 with error code: 0, instance data size: 0, internal state: Locked, Running, HasNewEvents, processing id: ecc13bbe-5615-43c9-9d83-e4a76aab5340   db1e1b31-a463-4fea-ba8d-f0d1161bdfd7

Line 5392: 02/13/2014 14:28:59.81             w3wp.exe (0x0F48)                       0x2FF4  SharePoint Foundation                         Workflow Infrastructure               88xr       Unexpected       WinWF Internal Error, terminating workflow Id# 555acadf-072b-4727-a6e7-b5b484b8ee64             db1e1b31-a463-4fea-ba8d-f0d1161bdfd7

Line 5393: 02/13/2014 14:28:59.81             w3wp.exe (0x0F48)                       0x2FF4  SharePoint Foundation                         Workflow Infrastructure               98d4      Unexpected       System.NullReferenceException: Object reference not set to an instance of an object.     at VTGetListItemAttachmentAction.Activities.VTListItemGetAttachmentActionActivity.Execute(ActivityExecutionContext executionContext)     at System.Workflow.ComponentModel.ActivityExecutor'1.Execute(T activity, ActivityExecutionContext executionContext)     at System.Workflow.ComponentModel.ActivityExecutor'1.Execute(Activity activity, ActivityExecutionContext executionContext)     at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)     at System.Workflow.Runtime.Scheduler.Run()             db1e1b31-a463-4fea-ba8d-f0d1161bdfd7

 

Friday, February 14, 2014 3:22:44 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Matt,

do you have the error handling enabled on the action?  IF not, please enable it, then store the error text in a text variable and email it yourself.  Them forward that on to me at vadim at vadimtabakman dot com.

I've looked at the code, and nothing really stands out to be suspicious.  I'm happy to send it to you.

cheers,

Vadim

Friday, February 14, 2014 3:31:41 PM
Matt

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

I attempted to enable error handling and although I can set the settings, when I configure the custom action a second time the Error handling fields appear empty again.

If I get error handling working I will forward you the error text.  Thanks.

Friday, February 14, 2014 3:40:24 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Matt,

shoot me an email and I can send you the latest build of the solution and you can see if that helps on a test environment.

cheers,

Vadim

Monday, April 7, 2014 5:00:29 PM
Mike Watt
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hey Vadim, 

Awesome custom action, Just caught this post on twitter and I'm going to add it into a workflow I built. I had the same issue but in testing found out that if you call the addattachment web service from a document library and use the [FileData] variable for the attachment node:

<m:attachment>[FileData]</m:attachment>

Then the call will succeed. So my OOTB process involved a staging library, a workflow that executed a Copy to SharePoint action on the attachments and then updated using a for each loop every item with the destination list item they were to be appended to. That update triggers a workflow in the temp list whose only purpose is to execute the web service call and then delete the file. 

This is much cleaner!

Monday, April 7, 2014 11:00:49 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Mike,

I've done exactly the same thing in the past, which is what prompted me to make this.

I really wanted to spend some time and make it upgradeable from the 2010 version of the action.  But too busy at the moment.

Thanks for the comment mate. 

cheers,

Vadim

Thursday, May 15, 2014 2:41:08 PM
Greg Robinson
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Once again, Vadim you have saved my rear with this work.  Thanks again for publishing this solution. I hope this functionality is pulled into Nintex because one should not have to go through this much trouble to move attachments!

Thursday, May 15, 2014 2:55:03 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Greg,

I'm glad this helped.  I'll pass that on to the dev team and see if we can add it to the product.

cheers,

Vadim

Monday, September 22, 2014 12:10:37 AM
Happy
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

 

I am using [FileData] instead of base64.earlier it was working fine now it is giving me error "Unable to test embedding file data with the [FileData] token"

<m:attachment>[FileData]</m:attachment>

 

Please suggest.

Monday, September 22, 2014 7:50:37 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Happy,

I don't know you're getting that error.  I haven't seen it before.

You should contact Nintex Support for that.

cheers,

Vadim

Friday, October 17, 2014 1:14:14 PM
Harish
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hello Vadim,

May I know what was the solution for Matt's issue. I have the same situation..

I have installed the custom action for 2010 and when we test  this action in a basic workflow to get the Base64 of an attachment of a flexitask with below mentioned parameters the error was - "Error performing database action. Object reference not set to an instance of an object.
An error has occurred in Copy Task attchments."

List name - Workflow Tasks

ID: FlexiTask id

Attachment Url: full url of attachment (I logged the url value in workflow history and made sure url is not broken)

OutPut: MultilineText variable

Note : 1) Error in SharePoint logs - same as Matt mentioned above (Friday, February 14, 2014 3:00:22 PM)
            2) Tried to enable error handling for this action but same as Matt mentioned below upon saving/passing variables to controls under error handling section as mentioned in help and reopening the task the variables assigned are disappearing (Friday, February 14, 2014 3:31:41 PM)

           3) Just as a test scenario I also tried to test to read the Base64 value of the attachment of current list item running the workflow. It also gave the same error...

Please suggest.

 

Thanks,

Harish

Friday, October 17, 2014 2:05:36 PM
Harish
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hello Vadim,

May I know what was the solution for Matt's issue. I have the same situation..

I have installed the custom action for 2010 and when we test this action in a basic workflow to get the Base64 of an attachment of a flexitask with below mentioned parameters the error was - "Error performing database action. Object reference not set to an instance of an object.
An error has occurred in Copy Task attchments."

List name - Workflow Tasks

ID: FlexiTask id

Attachment Url: full url of attachment (I logged the url value in workflow history and made sure url is not broken)

OutPut: MultilineText variable

Note : 1) Error in SharePoint logs - same as Matt mentioned above (Friday, February 14, 2014 3:00:22 PM)
2) Tried to enable error handling for this action but same as Matt mentioned below upon saving/passing variables to controls under error handling section as mentioned in help and reopening the task the variables assigned are disappearing (Friday, February 14, 2014 3:31:41 PM)

3) Just as a test scenario I also tried to test to read the Base64 value of the attachment of current list item running the workflow. It also gave the same error...

Please suggest.

 

Thanks,

Harish

Saturday, October 18, 2014 8:07:02 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Harish,

I'm afraid I don't know if Matt found a solution to this error.  I haven't been able to reproduce it, so I don't know what is causing it.

Does the error handling, if enabled, capture this error or does the workflow still fail?

Cheers,

Vadim

Friday, October 24, 2014 7:33:05 AM
Dave Plasencia
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

 

I'm not sure if other's have run into this issue, but when I try to import the Get_Attachment_base64_2013_Workflow.nwf file, I get a SharePoint configuration error.

Is the .nwf file not functional with recent releases for 2013 workflow?

 

Thanks,

Dave

Friday, October 24, 2014 10:57:40 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hey Dave,

It should work.  Do you have the action installed?

cheers,

Vadim

Friday, April 17, 2015 8:13:48 AM
LaKisha
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

HI Vadim,

Can you tell what the risk are to adding a custom action? If it were to fail or break, what is the risk to the rest of our environment?

Thanks!

LaKisha

Friday, April 17, 2015 9:35:54 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi LaKisha,

Based on the code, really the risk is that the workflow will fail.  That's all.

cheers,

Vadim

Tuesday, April 21, 2015 2:02:37 PM
AidaH
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hello Vadim

 I have the 2013 version, I followed the steps  and even do not see the action

Could you help me please

Tuesday, April 21, 2015 2:49:49 PM
AidaH
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

hello
now I have the 2013 version , I followed the steps of the blog and even do not see the action

Could you help me please

Tuesday, April 21, 2015 4:22:02 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi AidaH,

did you enable it in Central admin - Nintex Workflow Management - Manage Allowed Actions?

 

cheers,

Vadim

Tuesday, April 21, 2015 7:32:55 PM
Ruchi
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim

Do you have any idea if Matt/Harish ever got solution to their problem.

I am hitting the same wall unfortunately. I am using 2010 environment

Regards - Ruchi

Tuesday, April 21, 2015 10:20:42 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Ruchi,

 

I'm afraid I don't know if they got it resolved.

Vadim

Wednesday, May 20, 2015 5:30:19 PM
JulianD
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

 

Some time ago I installed an add on my farm sharepoint VT Get List item Attachment Complement. This looked and time is no longer seen after in the workflows designer. The supplement is still installed and the action is active.

 

Can you help me salling me,What could be happening?

 

Thank you! 

Wednesday, May 20, 2015 10:29:33 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Julian,

check in Central Admin > Nintex Workflow Management > Manage Allowed Actions and see if that action is there an enabled.

 

cheers,

Vadim

Thursday, May 21, 2015 10:24:56 AM
JulianD
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi! Vadim.

The action is enabled and the coplemente not is being seen in the workflows designer. 

 

Tuesday, June 2, 2015 10:22:17 AM
JulianD
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi! Vadim!

 

I can see this complement in the Site´s Worwflows, but no  in a List´s workflows. Have you idea what could be happening?. Any other configuration is necessary ?.

 

Thank you so much for you answer.

Tuesday, June 2, 2015 11:35:58 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

HI Julian,

I'm afraid I don't know what could be causing this.  There's nothing in the action that says it's only a Site workflow action.  Are you looking at the Site workflow and list workflow designer on the same site?

 

cheers,

Vadim

Tuesday, June 2, 2015 12:58:52 PM
JulianD
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim!

no sr, the workflow site are in a different site that the site where i deployed the solution

 

Tuesday, June 2, 2015 2:16:21 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi JulianD,

So if the Site where the action appears in the Site Workflow, is different from the site where you were trying to build a List workflow, then you need to go to the latter site, go to Site Settings and click on Manage Allowed Actions and enable that action on that site also.

 

cheers,

Vadim

Thursday, June 4, 2015 9:24:21 AM
ACarrell
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

I'm also getting the "Error performing database action. Value does not fall within the expected range." issue.

Digging a little deeper, I found the stack trace in ULS that shows the error:

System.ArgumentException: Value does not fall within the expected range.
at Microsoft.SharePoint.SPFolderCollection.get_Item(String urlOfFolder)
at VTGetListItemAttachmentAction.Activities.VTListItemGetAttachmentActionActivity.Execute(ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
at System.Workflow.Runtime.Scheduler.Run()

which suggests a problem finding a folder within the list.

Thursday, June 4, 2015 11:56:02 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi ACarrell,

hmm can you share how you have that action configured?

cheers,

Vadim

Thursday, June 4, 2015 1:23:11 PM
ACarrell
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

The set up is the same as you have in your sample workflow. I've tried it twice; once with the raw url culled from the GetAttachmentCollection response, and once with the url modified to replace spaces with '%20'

List Name: {Common:ListName}

Item ID: {ItemProperties:ID}

Attachment URL: {WorkflowVariable:attachmentURLtext} (Single Line of Text variable)

Base64 Output: {WorkflowVariable:bigString} (Single Line of Text variable)

Thursday, June 4, 2015 2:05:40 PM
ACarrell
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

 Further information: If I just use the filename portion of the attachment URL, I get a NullReferenceException instead of an ArgumentException.

System.NullReferenceException: Object reference not set to an instance of an object.
at VTGetListItemAttachmentAction.Activities.VTListItemGetAttachmentActionActivity.Execute(ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
at System.Workflow.Runtime.Scheduler.Run()

Thursday, June 4, 2015 2:07:22 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi ACarrell,

I'm not sure what is causing this.  Do you still have the same issue if you have a filename with no spaces and no other funny characters?

cheers,

Vadim

Friday, June 5, 2015 7:34:29 AM
ACarrell
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

 Doesn't seem to make a difference on the URL structure.

Also, even if I set error handling, the action still errors out and stops the workflow.

Friday, June 5, 2015 7:35:31 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi ACarrell,

which version are you using? 2007, 2010 or 2013?

cheers,

Vadim

Friday, June 5, 2015 8:47:38 AM
ACarrell
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

NW 2010

Wednesday, July 29, 2015 9:06:07 AM
Li
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

I'm running this in 2013.  There is an access denied error when someone who has contribute access runs the workflow. 

Error Getting List Item Attachment. 0x80070005Access denied

Wednesday, July 29, 2015 9:14:36 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Can you try adding this action into an Action Set and configure the Action Set Common Properties to run as workflow owner?

Does that help?

cheers,

Vadim

Wednesday, July 29, 2015 11:33:39 AM
Li
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Unfortunately, that was the first thing I tried, but there isn't the option to run as owner for the action set common properties. :/

Thursday, July 30, 2015 9:23:10 AM
Christian
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

first of all, thanks for this great extension.

I had the same error than ACarrell. The solution was quite easy: The ID of the list item was not correct.

Cheers, Christian

Thursday, July 30, 2015 3:51:53 PM
Li
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

I figured out why the "Run As Owner" option wasn't available.  Apparently if you have the action set within a for loop, that option disappears.  I am looping though the attachment collection, so have the custom get item attachment action inside the for loop.  I ended up sticking the for loop inside the action set.  Hopefully this works... and maybe will help others if they run into the same issue.

Monday, August 3, 2015 12:40:55 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Li,

good call.  Thanks for sharing that.

cheers,

Vadim

Thursday, September 17, 2015 5:31:51 PM
Eric
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim

I am using the action Workflow on 2013 and I have the "Object reference" error when try to get the attachment

This is the error from log file.

Nintex.Workflow.NWActionExecutionException: Error Getting List Item Attachment. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at VTCustomActions.VTListItemGetAttachmentActionActivity.Execute(ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
at System.Workflow.Runtime.Scheduler.Run() -
-- End of inner exception stack trace --- (Build:3080)

Could you please Help?

 

 

Friday, September 18, 2015 5:40:19 AM
Adriaan Oprins
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

I am trying to get your custom action to work on my SP2013 but I get this WF error

Error Getting List Item Attachment. List 'WorkflowTasks' does not exist at site with URL 'https://accteamsites.aoc.eu/Sites/TED'.

But I am a 100% sure it exists. What would be the correct way to reference the List Name?

Thanks in advance

Adriaan

Friday, September 18, 2015 3:56:17 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Adriaan,

Try putting a space in between Workflow and Tasks and see if that helps,

cheers,

Vadim

Monday, September 21, 2015 1:48:24 AM
Adriaan
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

Thnx for the quick response but still no luck. I tried all the permutations as well, like Workflow%20Tasks and /Workflow Tasks/ or /Workflow%20Tasks/.

It keeps giving me Error Getting List Item Attachment. List '/Workflow Tasks/' does not exist at site with URL 'https://accteamsites.aoc.eu/Sites/TED'

This I find in the ULS:

(https://accteamsites.aoc.eu/Sites/TED/_layouts/15/NintexWorkflow/preview.aspx?ListId=1abcc37c-0a5c-4612-8f8b-bff1b0c688f5&ItemId=3&InstanceId=66657099-4b7f-4b13-a51e-bf8bb460d8fa): Nintex.Workflow.NWActionExecutionException: Error Getting List Item Attachment. ---> System.ArgumentException: List '/Workflow Tasks/' does not exist

at site with URL 'https://accteamsites.aoc.eu/Sites/TED'. ---> Microsoft.SharePoint.Client.ResourceNotFoundException: List '/Workflow Tasks/' does not exist

at site with URL 'https://accteamsites.aoc.eu/Sites/TED'. -

-- End of inner exception stack trace ---

at Microsoft.SharePoint.SPListCollection.GetListByName(String strListName, Boolean bThrowException)

at VTCustomActions.VTListItemGetAttachmentActionActivity.Execute(ActivityExecutionContext executionContext)

at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)

at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)

at System.Workflow.Runtime.Scheduler.Run() -

-- End of inner exception stack trace --- (Build:3120)

Thanks for helping me Vadim,

Cheers,
Adriana

Monday, September 21, 2015 2:33:47 AM
Adriaan
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

Did a check with different list without space in name and it worked as expected, Attachment was copied. I must be close but still no luck with Workflow Tasks list.

Cheers,

Adriaan

 

Monday, September 21, 2015 10:02:26 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Adriaan,

try Workflow%20Tasks and see if that works?

cheers,

Vadim

Tuesday, September 22, 2015 12:59:29 AM
Adriaan
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

Yes I tried it and it does not work. I still get Error Getting List Item Attachment. List 'Workflow%20Tasks' does not exist at site with URL 'https://accteamsites.aoc.eu/Sites/TED'.

I also cannot activate the Error handling. I can it set to Yes and when I save it and reopen the action is says No again.

I have seen the action work properly yesterday but am unable to reproduce it with the Workflow Tasks list. Do you know maybe how to have a Request data action store items in a custom list? I can see no setting for it in the UI.

Cheers,

Adriaan

Tuesday, September 22, 2015 6:03:50 AM
Adriana
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim,

It worked, I created a custom task list in Workflow settings with a space less name and now it works as expected.

Thanks for the support

Cheers,

Adriaan

Thursday, October 1, 2015 5:28:46 AM
Paul
Gravatar

System.NullReferenceException: Object reference not set to an instance of an object.

If anyone gets "System.NullReferenceException: Object reference not set to an instance of an object", I have found the only fix to be to use a task list without a space in the name. After 2 days of scratching my head I finally logged the values of task_id, task_list and attachment_url (which are passed to the getattachment shape) to the history list. I could see that task_list was set to 'Workflow Tasks' but the url had /WorkflowTasks/. Not sure if this is the issue.

I tried 'WorkflowTasks' without the space but the task list could not be found. I also tried 'Workflow%20Tasks" but had the same error as below.

10/1/2015 11:23 AM Workflow Comment Error Getting List Item Attachment. Object reference not set to an instance of an object.

Finally I chose 'create new task list' inside the Nintex workflow properties and chose a name without a space. I can now get the attachment is base64. Hope it helps someone and perhaps can be handled in Vadim's next code?

Sunday, November 8, 2015 6:09:46 PM
Mark Peacock
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi,

I have successfully implemented Vadim's awesome custom action previously without issue. Also note that all my lists involved in this implementation did have spaces in the names.

I then tried to implement it on another list, but struck issues with the "Object reference not set to an instance of an object" error. I finally believe I have got it working and what the root cause was.

The issue was that my List name did not match the URL list name component, so for example, my List name was "Test List", but my url had "Test Dev" as the list component of the url. I used Sharepoint Designer to rename my web address to match the List name and I no longer received the error.

So there appears to be an assumption that the List Name and the url List reference should be the same.

I hope this helps others.

 

Cheers,

 

Mark

Sunday, November 8, 2015 7:13:19 PM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

hi mark,

thanks for pointing that out. I'll need to look into this. This week make it easier.

cheers

vadim

Thursday, November 12, 2015 7:52:09 PM
KH
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi,

I got the following error for the action when I ran the workflow:

Error Getting List Item Attachment. Unrecognized activity encountered: VTCustomActions.VTListItemGetAttachmentActionActivity.

What would be the likely cause?

 

Cheers,

KH

Tuesday, November 24, 2015 7:11:17 AM
Nishant Meher
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hello Vadim, 

Thanks for your article. It helped me lot. One error i am getting with the files of type .msg files as a attachment. I am copying the list item attachments to a particular library in my site. All files except the .Msg files are get copied to the library. Neither I am getting any error nor any warning message. 

Can you please help me on that ? That would be a great help. Let me know if you need more inputs from my side.

 

Tuesday, November 24, 2015 8:24:38 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Nishant,

are you using this custom action to read the attachment and you're getting no data?

This could be that SP treats MSG files differently and the URL doesn't provide access to the file itself.  In that case, I don't have a solution for that at the moment.

Vadim

Tuesday, December 15, 2015 3:07:06 AM
Maxime Weigel
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi,
I'm on 2013 environment. I've downloaded the files :
Get and Log Attachment Workflow (2013)
Download VTCustomActions.wsp SharePoint 2013 Solution
I've installed, did a IISReset and deployed the solution (no problem appeared).
However, I don't see anywhere the .nwa file.

So I don't where I'm wrong. Can you help me. Is it possible to download anwhere the .nwa file for 2013 environment ?

Cheers,

 

Tuesday, December 15, 2015 5:39:39 AM
Maxime Weigel
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

I've finally found the .nwa file here : C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\FEATURES\VTCustomActions\.

Thank for your great job ! That's help me a lot.

Tuesday, December 15, 2015 7:11:00 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Maxime,

glad you found it. :)

Vadim

Thursday, February 11, 2016 1:21:22 AM
Maxime
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi,

I've installed this solution on 2013 environment. It perfectetly works until now. In my workflow, I get Attachments URL of an item (incoming email) to add these attachments to another item in other list.
I don't no why, suddenly, the custom action doesn't work. The message error is : "Error Getting List Item Attachment. Object reference not set to an instance of an object.". However, I check the NameList, Item ID and attachment URL. So is it possible to modify the source code to modify type of object or just delete the type ?
 

Maxime

Thursday, February 25, 2016 8:13:17 AM
Senthilselvi
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Vadim,

  1. I'm on SharePoint 2013 environment. I've downloaded the files 
  2. Get and Log Attachment Workflow (2013)
  3. Download VTCustomActions.wsp SharePoint 2013 Solution
  4. I've installed, did a IISReset and deployed the solution (no problem appeared).
  5. I imported Get_Attachment_Base64_2013_Workflow.nwf in my list, but its missing an User Defined Action "Get Attachment Urls UDA".

Please help me where could I find that piece.

Thanks

Selvi

 

Thursday, February 25, 2016 11:10:40 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Senthilselvi,

the UDA can be found here: http://www.vadimtabakman.com/nintex-workflow-get-attachment-urls-uda.aspx

Vadim

Wednesday, March 2, 2016 7:38:16 PM
Keng Haw
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Dear Mr Vadim,

I deploy the solution for Download VTCustomActions.wsp SharePoint 2013 Solution without issue but I can't find the nwa file to run the command (NWAdmin -o AddAction -nwaFile VTListItemGetAttachmentAction.nwa) and the new action is not appear in central administrator manage action. Could you help please?

Monday, March 7, 2016 9:24:26 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Keng,

it's been a while since I've looked at this.  Can you look on your farm servers, in the HIVE and see if the NWA file is there?

Vadim

Wednesday, March 9, 2016 6:08:23 PM
Keng Haw
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Dear Mr Vadim,

Could you share how can I convert the url retrieved from the list attachment to base64 format? I was able to get all the url in list attachment and show in task form but unable to add the attachment in task form back to list item as base64 url is required for web service method "AddAttachment".

Thursday, March 10, 2016 8:55:45 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Keng,

without this addon that's available on this post, there's no way that I know to get data into Base64 format in a workflow.

I've put the request on the Nintex UserVoice. Please vote it up and add comments : https://nintex.uservoice.com/forums/229405-1-nintex-workflow-for-sharepoint/suggestions/12882366-read-document-contents-as-base64-into-a-text-varia

cheers,

Vadim

Monday, April 18, 2016 4:03:53 PM
Keven
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Realizing that it has been a while since you worked on this workflow action ... I was able to install everything successfully, but when I use the action in a workflow and run the workflow, I get the following error when it reaches the step for your custom action:

Comment  varError: attachments_xml: <Attachments xmlns="http://schemas.microsoft.com/sharepoint/soap/"><Attachment>http://connecttst/nintex/Lists/testnintexattachments/Attachments/19/testdocument.txt</Attachment></Attachments>

Comment  Error Getting List Item Attachment. Input string was not in a correct format.

Any idea what might be causing this error or how to go about troubleshooting? My variables are single line of text.

Thursday, May 5, 2016 12:41:45 AM
Keng Haw
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Dear Mr Vadim,

I've used your solution to get the base64 URL for few months and it work perfectly. But since yesterday it suddenly not working as the workflow will stop at the action but did not cause the workflow error. The workflow just stop there and not proceed anymore. Could you advise what would be wrong as no change to the workflow at all as running ok before yesterday.

 

Thursday, May 5, 2016 11:26:05 AM
Kristi Gift
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hello Vadim,

Quick question on this custom action for retrieving attachments from a Nintex Form into a SharePoint Library....does your code work for SP2013 O365? As you know, there is no Central Admin in SP online so I was wondering if you have a SharePoint Online solution as well?

Thanks in advance!

Kristi

Thursday, June 16, 2016 5:09:18 AM
Nero
Gravatar

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Vadim Tabakman

Is there any way to manage this in SharePoint Online. To add Attachments to List Item.

From List A to List B

Thursday, June 16, 2016 8:07:26 AM

re: Nintex Workflow - Get List Item Attachment in Base64 Custom Action (Happy Thanksgiving)

Hi Nero,

I'm afraid I haven't see a way to do this in SPO.

Vadim

You must sign in to this site to post comments.
Already Registered?
Sign In
Not Yet Registered?
Register





 

Statistics

  • Entries (253)
  • Comments (1737)

Categories