SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a field called "Bulletin#" in my InfoPath form that increments on submit based off of the OOTB SharePoint column "ID".

The rule on clicking "submit" is to check to see if the field "Bulletin#" is empty; if not set the value to max(ID)+1. I have setup a receive connection to query ID.

I followed the same approach; created a receive connection to query Bulletin# (with the library sorted according to ascending ID, so it would get the last Bulletin# used) and use max(Bulletin#)+1. But I end up getting this:

enter image description here enter image description here

Is there a workaround or another approach to it?


share|improve this question
What is max(Form#) returning? NaN is "Not A Number" – RJ Cuthbertson May 15 '12 at 20:48
@rjcup3 yes max(form#) returns nan, although I have set up the field with a integer data type. But max(ID) returns an integer. – user7400 May 16 '12 at 0:26
up vote 0 down vote accepted

When I was selecting the field from the insert field wizard, I was selecting from under the query fields. When I selected from the data fields it worked just fine. enter image description here

share|improve this answer

max(field) + 1

doesn't always work... if the form is opened in edit mode it increments again.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.