Contents of a SharePoint Library

Comments

12 comments

  • Avatar
    Lucas Drege

    Hi Brad,

     

    Yes, this can be achieved using CAML query SharePoint activity as described below.

    Using the CAML query activity, find the library or list where the documents are stored.  We will then map the data to a repeatable control in AgilePoint.

     

    The File names will be returned in the following format.

     

     

    For your reference, I have also linked the relevant documentation for CAML query, and for the Looping activity. 

    Let me know how this works out for you, please.

    Lucas

  • Avatar
    Brad Harr

    I followed the directions and was able to query a library, great start!  I'm not quite there yet when trying to turn that data into a repeatable variable.  I've tried replicating the loop activity example.  When running the workflow, I entered 4 lines or events for employee leave.  I checked the SharePoint list after the workflow ended and it wrote 4 lines as I had hoped, but it just repeated my first entry 4 times, so no success as of yet.  I'm still trying to see if I missed something though...

  • Avatar
    Karl Makatenas

    What is the variable you're using to index the loop array?  How are you using it?

    On one of my processes, I pulled the data into a single Process Variable and posted the contents of that Process Variable into the list, then the next loop iteration copied the repeating row into that singular Process Variable again.  That method ignores loop indexing so it should be pretty easy to configure.

  • Avatar
    Brad Harr

    I think it's a hidden field called ItemID.  The instructions have you place the hidden field in the subform, but all you do is call it "ItemID" and that's it.  It's not referenced in any other activity.  So for example, I have a repeating subform that asks for names.  Filling out the form, I put in 3 names:  Joe, Mike, and David... then SUBMIT.  On the SharePoint list that the workflow writes to, it will write 3 line items to the list, but it will be: Joe, Joe, Joe.  It's not ticking down to the next line item.  So if it gets the number of items correct, but only spits out the first entry that many times, it has to have something to do with forcing it down each item. 

    Hope that makes since... I feel the answer is staring me in the face, but I can't find it.

  • Avatar
    Karl Makatenas

    Can you post a picture of your Initialize Loop configuration?

  • Avatar
    Brad Harr

    See Below.  Thanks!







  • Avatar
    Karl Makatenas

    Most peculiar.... I set up a quick loop similar to yours and got all the different items posted correctly.  The only things I can think of are:

    1) In your fourth picture, make sure that you have the right Loop Initiate Activity Name (which you probably do).
    2) In the eForm, make sure the subform is repeatable on the configuration (second) tab (which it probably is).
    3) You're right that the ItemID isn't necessary; I'm not sure what resource you were using.  Go ahead and delete it along with the hidden field.
    4) Do you have any nested subforms or is that a top-level subform on the eForm?  If you're dealing with nested subforms, the configuration can get a bit weird.

    After that, I'm nearly out of options :(.

  • Avatar
    Brad Harr

    I double checked the items you pointed out and confirmed correct.  I also took out the ItemID.  I am still getting the same result (see below).  The only other thing that I missed before was that you can set the model data as repeatable in the schema.  Before it was not selected.  I went ahead and selected repeatable for all the model data, and I still get the same result.



  • Avatar
    Karl Makatenas

    *facepalm*  The process variables should be going to the list, not the form variables.  Your first picture from two posts ago.

    Wow, that took me longer than I expected >.>;;;;

    At least you've gotten some good experience with all this configuration stuff and I may actually remember this solution now that I've hit this problem a half-dozen times.  I still want to punch myself, though.

  • Avatar
    Brad Harr

    Boom!  It works!  You sir, are my hero for the day... I thank you for taking the time to help me with this!

  • Avatar
    Brad Harr

    Ok... I'm trying not to be hand-held thru all this.  I've successfully created the CAML query, it gave me the results I wanted during the test.  I've also successfully done the looping example provided by AgilePoint with the help of Karl. 

    However, I'm having a hard time using the loop example with my business case.  In the example, a subform provided the dataset.  In my case, a CAML query should be the dataset, I think?  So then what would be the "Current Row Variable" in the Loop configuration? 

    My goal is to transcribe the list of queried documents into a single Word document.   

    Anyone's help is greatly appreciated! 

  • Avatar
    Karl Makatenas

    The CAML query should populate a repeating process variable group that houses the data like you said, and that group will be the dataset group in the Initialize Loop activity.  You should also create a few non-repeatable process variables to store the row data for each iteration of the loop so that you can populate the Word document one row at a time.

    I haven't used any Word activities yet, so I'm not sure how that configuration would go.  I'm used to using the Update Process Data activity to concatenate a bunch of strings together, so I'd use a single concatenated process variable to populate an email with inline content.

    Hopefully that works out!

Please sign in to leave a comment.