Counting the number of files created today

Z

Zen Monkey

I have the need to perform a calculation that uses the number of
infopath files that are in a MOSS library that were created on the
current day. Does anyone have any idea how to do this?

TIA
Gyan.
 
S

S.Y.M. Wong-A-Ton

A SharePoint list/libary has a "Date Created" column where the date is
stored. So you can create a data connection to the library where the forms
are stored and make sure to select that "Created" column from the list of
columns. Then you can use the count() function in a rule together with an
XPath filter on the Created attribute to count the amount of forms that were
created on the current day.
 
Z

Zen Monkey

A SharePoint list/libary has a "Date Created" column where the date is
stored. So you can create a data connection to the library where the forms
are stored and make sure to select that "Created" column from the list of
columns. Then you can use the count() function in a rule together with an
XPath filter on the Created attribute to count the amount of forms that were
created on the current day.
---

Thank you for your reply.

The XPath that was generated in InfoPath looks like this:
count(xdXDocument:GetDOM("Retrieve File Count")/dfs:myFields/
dfs:dataFields/dfs:Orders/@Created[. = xdDate:Today()])

However, it only returns zero to Infopath. regardless of the number of
entries in the library (there are currently two files that have been
created).

The way that the system works is that each person may only create one
file per day (the filename is [UserName]-[Today()] (e.g.
ZenMonkey-2008-01-09).) If someone creates a new infopath file when
they already have one for the day, it overwrites their current file.
Previously, I had tried using the filename [UserName]-[Now()], which
created multiple files as expected. When that happened, InfoPath
returned the count for the files I created, but did not include the
count for the other users.

Any idea what I'm doing wrong?
 
S

S.Y.M. Wong-A-Ton

I liked your scenario so much that I blogged about it yesterday. Follow the
instructions in this post (http://enterprise-solutions.swits.net/blog/?p=41)
and see if things work better.
---
S.Y.M. Wong-A-Ton


Zen Monkey said:
A SharePoint list/libary has a "Date Created" column where the date is
stored. So you can create a data connection to the library where the forms
are stored and make sure to select that "Created" column from the list of
columns. Then you can use the count() function in a rule together with an
XPath filter on the Created attribute to count the amount of forms that were
created on the current day.
---

Thank you for your reply.

The XPath that was generated in InfoPath looks like this:
count(xdXDocument:GetDOM("Retrieve File Count")/dfs:myFields/
dfs:dataFields/dfs:Orders/@Created[. = xdDate:Today()])

However, it only returns zero to Infopath. regardless of the number of
entries in the library (there are currently two files that have been
created).

The way that the system works is that each person may only create one
file per day (the filename is [UserName]-[Today()] (e.g.
ZenMonkey-2008-01-09).) If someone creates a new infopath file when
they already have one for the day, it overwrites their current file.
Previously, I had tried using the filename [UserName]-[Now()], which
created multiple files as expected. When that happened, InfoPath
returned the count for the files I created, but did not include the
count for the other users.

Any idea what I'm doing wrong?
 

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