Skip to main content

Here is the scenario I have:

  1. Documents are uploaded into a document library with an associated ProjectID.
  2. I have a list to track whether or not the required documents are uploaded.  The ProjectID of a document may be listed and associated with multiple items in this list.
  3. Once the workflow matches a ProjectID, it should update those items with Today's Date and a link back to the document.

I thought I would use the Loop action but am having a hard time getting started.

Hi Teresa,

The workflow architecture I'd introduce would probably depend on what you would want to launch this process.  Also the process could be slightly different depending on whether you are using on-prem or O365, but in generic/general scenario you will want to:

Use the Query List action to return a collection of items that match your ProjectID for the document.   You can put a filter on this action to specify a specific ProjectID - in this case the one .  For example, if you wanted all items where ProjectID = 100 you could achieve this with this action.

Once the query returns you will have saved the results into a Collection Variable.

Now you are able to use either the Loop Action (or preferably (for me anyways) the For Each action) to loop over this collection.  Inside of the loop, you could then use an Update Item action to make the updates you need to your target list.

Hope that helps a bit.

Mike


Hi Ira,

You are on the right track for sure!   Here is the SOAP xml that you will need to place inside of the GetListItems webservice. When you are configuring the web service action, click on the SOAP editor radio button and copy and paste the below code in.  Make sure to insert the variable that would be applicable to you where I have it in bold.  With this I'm sure you will be able to figure the rest out.

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

    <soap:Body>

        <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">

            <listName>Your List Name</listName>

            <viewName></viewName>

            <Query>

                <Where>

                <Eq>

                    <FieldRef Name="ProjectID" />

                    <Value Type="Text">{Insert Your Reference Var or Property Here}</Value>

               </Eq>

               </Where>

            </Query>

        <viewFields></viewFields>

        <rowLimit></rowLimit>

        <QueryOptions></QueryOptions>

            <webID></webID>

        </GetListItems>

    </soap:Body>

</soap:Envelope>


Reply