cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Get List of Items Located in a Document Library Folder

Jump to solution

The problem I am trying to solve is to determine if there is a specific word document in a specific folder located in the "Project Documents" library of a SharePoint 2016 site.  My site structure would be something like this: //server/sitename/project documents/folderA/.  Within the folderA, I need to know if there is a document called "status report."  These would all be on Alternate Sites than from where the workflow runs.

Using a "Call Web Service" "sitedata.asmx" method, I am able to see the content on the site "//server/sitename/".  The content is stored in a collection variable which I then loop through (for each) to see if there is an item called "Project Documents" and I find one.  Then I use a Query List (CAML editor) to retrieve the contents of the Project Documents library.  I am able to find the Status Report folder within the Project Documents library, but I am not able to figure out how to get the contents of that specific "Status Report" folder.  I have tried a few different Query List options.  I am clueless when it comes to Soap, Web Service Calls, etc.  I used the documentation (found here) created by as a "template."

Any help would be greatly appreciated as I have been working on this for a couple of days.

Labels: (1)
Tags (1)
Reply
5 Replies
Workflow Hero

Re: Get List of Items Located in a Document Library Folder

Jump to solution

I think you do not need to bother with any web services.

simply let the query list action search for your specific document name. unfortunately it doesn't support to search within a specific folder, however it returns all the documents with a given name within library regardless of their location.

if you let it return one of URLs field you can then examine the path whether the document is placed in your specific folder.

Reply
Workflow Hero

Re: Get List of Items Located in a Document Library Folder

Jump to solution

Thanks for the reply.  I am able to get your suggestion to work; however, as stated in my initial question, I need to get the information from an alternative site.  When I enter the alternative site (http://server/sites/alternativesite) the Query List command gives the following error. "The execution returned an unexpected error.
The Web application at http://server/sites/alternatesite could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application".  I can change the "alternative site" field to be the current site where the workflow is running and the command works correctly.  Thoughts?

0 Kudos
Reply
Workflow Hero

Re: Get List of Items Located in a Document Library Folder

Jump to solution

it should work as far as alternative site runs within the same farm.

is your alternative site from different farm?

0 Kudos
Reply
Workflow Hero

Re: Get List of Items Located in a Document Library Folder

Jump to solution

I wasn't on the same farm.  I was doing this in our TEST environment.  For grins and giggles I thought I would give it a try in our PROD environment and it started working.  Your solution was spot on!  Thanks for your help.

Reply
Workflow Hero

Re: Get List of Items Located in a Document Library Folder

Jump to solution

great!

please mark the question answered.

0 Kudos
Reply