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

How to get attachment URL to base64?

I have had Vadim's custom action since past two years, and it has worked before but now i cannot get it to work now. Also @vadim_tabakman's blog post has not been updated in years. I am not sure whether it is still working.

I get below error, and i am able to get attachment URL's properly.

Error Getting List Item Attachment. Object reference not set to an instance of an object.

 

Is there any way we can convert the list attachments, or even a document as base64 with nintex workflow?

Labels: (1)
0 Kudos
Reply
8 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: How to get attachment URL to base64?

Hi,
If Vadims action is no longer working in your environment you may want to look at the following thread which discusses other methods to move attachments on List Items.
https://community.nintex.com/t5/Nintex-for-SharePoint/Is-it-possible-to-use-a-Nintex-workflow-in-Sha...
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to get attachment URL to base64?

@SimonMuntz,

I have followed the steps and created a new document library to copy attachments to. I am running workflow from the library to call web service to get attachments as base64 binaries but i am not sure what i am missing:

call web servicecall web service

0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: How to get attachment URL to base64?

Hi,

What you are doing looks correct to me and worked when I tested it.
I suggest trying to hardcode everything first instead of using references just to make sure everything is working.
If you are on a subsite make sure you add that to your URL.
Hardcode your list name,ID and filename and see how you go.
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to get attachment URL to base64?

@SimonMuntz 

I get below error when i do that:

 

Failed to invoke web service. Error returned from server: <soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.

 

0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: How to get attachment URL to base64?

Hi,
This appears to be more an issue with the webservice than the action configuration.
I suggest testing to make sure the web service is functioning as expected first using a tool like postman or similar.
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to get attachment URL to base64?

@SimonMuntz 

I am using web services in other solutions and it is working fine. I really appreciate your patience in helping me.

0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: How to get attachment URL to base64?

Hi,
This post had the same issue and used the Encode inserted tokens check box to resolve the issue. This is why I suggested testing this by hardcoding everything instead of using references to eliminate other things that can cause issues.

https://community.nintex.com/t5/Nintex-for-SharePoint/Call-Web-Service-GetListItemChanges/m-p/5961
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to get attachment URL to base64?

@SimonMuntz 

I am finally to make this work, i was doing it all wrong in hopes of getting the BASE64. I had the workflow created in the document library and trying to add attachment in the same library, which did not work. Now, i have the workflow in the document library, run workflow on the document to add attachment to another list item. Below is the config:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/sharepoint/soap/">
<soap:Header>
</soap:Header>
<soap:Body>
<m:AddAttachment>

<m:listName>Destination List Title</m:listName>

<m:listItemID>Destination List Item ID</m:listItemID>

<!--Below {ItemProperty:FileLeafRef} is the name of the document in the document library -->
<m:fileName>{ItemProperty:FileLeafRef}</m:fileName> 
<m:attachment>[FileData]</m:attachment>
</m:AddAttachment>
</soap:Body>
</soap:Envelope>

0 Kudos
Reply