0

Is it possible to use the Call HTTP Web Service action to create a simple file in a library in SharePoint Designer Workflow?

The REST API I am using is https://yoursitehere/_api/web/GetFolderByServerRelativeUrl('Shared Documents')/Files/add(url='a.txt',overwrite=true) which successfully creates a new file.

However, using the advanced properties for the action to set the request content only appears to allow for using a Dictionary variable. My new file's contents look like:

{"body": "test, test, test"}

When the desired outcome would be a file that just contains the text "test, test, test".

Here is a screenshot of the workflow action's advanced properties and the dictionary I'm using for my Request Content. s

I have seen this question on MSDN, which suggests this isn't possible, but since it was from 2014, I thought I'd ask here.

My desired end result is to create a CSV file with the file names for all attachments to a list item. The Call HTTP Web Service step works well to return the list of attachment names. Perhaps there is some other out-of-the-box way to do this in SharePoint Designer Workflow?

  • Just found that removing the "/" from the relative URL portion does allow the file to be created and returns an OK request status code. So now I simply have to figure out how to add data to the file. – hilary Mar 17 at 22:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.