Nintex

Nintex Connect
Metalogix
Metalogix
BlueStripe
BlueStripe

Training - Combined Knowledge

Training - TekDog Inc

Nintex Workflow - Creating a Text File in a Document Library

  • RSS
  • Add To My MSN
  • Add To Windows Live
  • Add To My Yahoo
  • Add To Google

Statistics

  • Entries (119)
  • Comments (310)
Posted by Vadim Tabakman Tuesday, August 07, 2012 7:46:00 AM Categories: Build Dynamic String Build String Nintex Nintex Workflow Switch Web Request XPath XSLT

Thanks to the user on Nintex Connect named "Dierk", it's quite simple to create a text file in a document library using Nintex Workflow.

The great thing is, you don't just have to create a flat text file, you can also create other files that are also text based.  Eg.  CSV (comma separated values file that can be opened in Excel).  XML files if you need to store some configuration data.  Even InfoPath forms are XML files, so if you had the spare time and wanted to build up your own InfoPath form xml file, you could do that too.  You could also create HTML files.  You could be making a web service call and get XML back.  You could then use XSLT to transform that into HTML and write the HTML to a file in a document library.

How do we accomplish this?

We use the Web Request action.  A very powerful action which most people don't use because it is a little intimidating.  There are some obvious configuration options like GET and POST.  There are also 2 options for the two versions of SOAP packets you can create to call web services or WCF services.  Then there's the "Other" option.  This is the option we will use in this example because what we want to do is PUT file in a library.

For the URL, we put in the full url including the filename of the document we want to create.

In the body, we insert the text we want as the contents of that file.

That's all there is to it.  It doesn't seem as scary now does it :).

Example

I've created the following:

SharePoint List named "Create Text Files".

SharePoint Library named "Text Files".

The list will contain a choice field where you can pick if you want to create a Text file or a CSV file.  The workflow will then take the title of the item, add the appropriate extension, create a dummy body of the type of file, and then create that file in the library.

As you can see, it's a fairly straight forward workflow:

The Web Request is looks like this:

NOTE: If you create a list and library with the names above and then import this workflow into the list, you should have no problems running this test workflow, excepy you will need to update the credentials used in the Web Request action.  I've configured it to use a Workflow Constant I have.  So either create a constant with that name, or put in the appropriate credentials.

Copyright Vadim Tabakman

re: Nintex Workflow - Creating a Text File in a Document Library

Thursday, January 10, 2013 12:08:01 AM Bhuti

Thank you Vadim,

This really came handy today. I needed to create an xml everytime an item is created and I used this guidelines instead of creating text, I created an xml and it worked like a charm.

I like that PUT method on the web request action.

Regards

Bhuti

re: Nintex Workflow - Creating a Text File in a Document Library

Wednesday, December 19, 2012 9:28:43 AM

Hi Robin,

there is a Web Request action in NW2007 also, although I haven't tested this functionality out in SP2007.

cheers,

Vadim

re: Nintex Workflow - Creating a Text File in a Document Library

Wednesday, December 19, 2012 8:51:45 AM

Very interesting and powerful option - just in time as we need to get XML output of metadata from a SP 2007 document library to a file share.

Just to be sure, the Web Request action is in 2010, I presume it's the Call Web Service action in SP / Nintex 2007?