Need to Count the Forms in a Form Library using VBscript

N

Noah Kaufman

Hi -

I have a form that needs to be able to return the number of InfoPath forms
contained within an InfoPath form library within SharePoint using vbscript.

I have already set up the form library as a data source in my form.
Assuming the data source is called "foobar", what would be the xpath that I
would pass to the .selectNodes() method in order to be able to then use
..nextNode() to be able to go through the nodes sequentially? (so that I can
count them)

Alternatively, if this is _not_ the best way to count the number of XML
documents within the form library -- what would be a better method, assuming
that I have to use vbscript to do it?

Thank you very much, in advance, for taking the time to answer my question.

Sincerely,

Noah Kaufman
New World Design
Cambridge, MA, USA
 
S

Shiva (GGK Tech)

Hi,

You have to give the XPath from root node to your repeating node (whichever
you want collection of nodes).

dim nodes = foobar.selectNodes(“XPath of your repeating sectionâ€);
dim count = nodes.length;

Check the below link you can get the idea about XPath:
http://www.w3schools.com/xpath/xpath_nodes.asp

Hope this helps you.
 
N

Noah Kaufman

Hi Shiva -

Thank you very much for responding to my post.

Yes, I understand that we have to specify the XPath expression for the
SharePoint forms library. My question is what _is_ the specific XPath for a
form library in a top-level site collection called "foobar"?

I've tried using similar XPath to what one would use for a list in
SharePoint without much success, so I thought that perhaps the specific XPath
syntax or content was different when attempting to manipulate a SharePoint
form library.

Sincerely,

Noah Kaufman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top