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

Get document from Document library as Base64

Jump to solution

Hello,

please is there any posibility, how to store document content from SharePoint online Document library as Base64?

I remember that in on-premise version of Nintex Workflow is there that "magic" with [FileData], but it looks, this is not working in Nintex Workflow for O365.

Thank you

Labels: (1)
0 Kudos
Reply
8 Replies
Highlighted
Automation Master
Automation Master

Re: Get document from Document library as Base64

Jump to solution

Hi!

The only way you can get file contents from SharePoint Online is to get it as binary. You can do it using "Web Request" action to call library REST Api. But there is no OOTB way to encode this binary string to Base64... Possibility you should write your own provider-hosted app to achieve it.

Moreover I found out, that text variables in Nintex for O365 does not support binary strings as they are somehow loosing information about the null bytes. I faced that problem when I was trying to upload such way obtained binary string back to the library - that way created file was corrupted

 Regards,

 Tomasz

Reply
Highlighted
Nintex Newbie

Re: Get document from Document library as Base64

Jump to solution

Hi Tomasz,

thank you for your response...I've also found that solution with binary file content via REST api call, but for my project is only base64 file content allowed :(

Regards,

Milan

Reply
Highlighted
Automation Master
Automation Master

Re: Get document from Document library as Base64

Jump to solution

Then the only way I see is to create a custom provider(azure?)-hosted app that will receive fill details, then will get file contents, encode it to Base64 and return such created string. You would be able to use it then via "Web request" action

Regards,

Tomasz

View solution in original post

Reply
Highlighted
Nintex Newbie

Re: Get document from Document library as Base64

Jump to solution

Yes, this is the only way - and already prepared :)

Now I have all, what I need.

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Get document from Document library as Base64

Jump to solution

Glad I could've guided you to the right solution

Reply
Highlighted
Nintex Newbie

Re: Get document from Document library as Base64

Jump to solution

@milan_chaloupka @TomaszPoszytek , thanks again mates, 

question: if the Provider Hosted App sits on an Azure Web Service, and is installed as an Add-In in SharePoint Online, you are saying my Nintex web request action (to get the Base64string) can call it without additional authenticating (since its already has permissions in app catalog)?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Get document from Document library as Base64

Jump to solution

Hi there,

as this is an old post: is there an "integrated solution" for this Problem. Itry to add a word document as list attachment and the file is corrupted using

"<attachment>base64Binary</attachment>"

within the web request and the workflow failed, using

"<attachment>[FileData]</attachment>"

 

Maybe, there is another workaround for this?

Many thanks.

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Get document from Document library as Base64

Jump to solution

Milan, can you select one from the answers as "correct"? Regards, Tomasz.

Reply