Only Positive Integers Allowed - InfoPath Form 2010/SharePoint List

Hi,

I am currently having an issue where a specific lookup field in one of my SharePoint List Forms is erroring out and is saying "Only Positive Integers Allowed". I have looked through different forums to try and find a solution to this, but have not had any luck.

Within the SharePoint List Form there is a List Filter that deploys the project title to the project title field. After the project title is filled in the field is highlighted by a red checkered box, and "Only Positive Integers Allowed" appears.

The project title field is not a required field, but it is a lookup. I have gone to InfoPath and have checked the settings there as well:

The field's value is set as d:ID rather then d:title.

Cannot be blank is unchecked and the form publishes successfully.

I read that a quick fix to this would be by going to the Main Data Connection > dataFields and selecting the proper field, once there deselect "Value". However, when I went to the Default Values section to complete this there wasn't a Value field to deselect.

Any help would be greatly appreciated!

Thanks,

January 18th, 2013 5:15pm

In the "fields" pane on the right, open up your field that the drop-down uses.  What type of field is it?  Text? Number? Integer?  I think you probably need to change the field type.
Free Windows Admin Tool Kit Click here and download it now
January 18th, 2013 6:43pm

Hi Laura,

It is Lookup field that is set up as a Drop-Down List.

January 18th, 2013 7:03pm

Look at the actual field type in the list of fields on the right, not the type of control.  Look at the properties of the field in the list of fields.
Free Windows Admin Tool Kit Click here and download it now
January 18th, 2013 9:11pm

Here is a screenshot of the properties.

Hope this helps.

January 18th, 2013 9:23pm

Hi,

When set a lookup field value, you need to set an ID to the field not the actual value it displays.  

Thanks,

Entan Ming

Free Windows Admin Tool Kit Click here and download it now
January 21st, 2013 5:42am

Hi Entan,

I believe the value is already set as ID which is why I am still having issues.

Any suggestions? I keep getting the same error.

Thanks,

Greg

January 21st, 2013 2:53pm

hi,

Is your list form part of your workflow task form or a new item form?

can u try to map both the value and display name to ID and check if the error is still there.. I guess the field is expectivng an interger but u r maping it to some other value. i look up field internally looks for an ID to map with the value..

Free Windows Admin Tool Kit Click here and download it now
January 21st, 2013 6:45pm

If your form is a sharepoint list form, you're only supposed to edit the list of choices in the column settings in the list setting screen.  If you edited it in the form, or in both places, maybe that's the problem. 

  1. Go to list settings, click that column, and make sure the choices are correct.
  2. Edit the form in InfoPath, and remove the drop-down box, and then drag the field onto the form all over again, so that it's new/clean.

See if that fixes it.

January 21st, 2013 6:53pm

I appreciate your assistance with this, but it looks like this project has been scrapped. I was never able to have it work out, so I am not sure if it was a bug or something.

Thanks,

Greg

Free Windows Admin Tool Kit Click here and download it now
January 23rd, 2013 5:47pm

Infopath cannot process lookups properly. Like Yes'No fields or required fields.

InfoPath should never be used on SharePoint due to it's incompatability with SharePoint. 

Use designer if available.  If not, just use SP out of the box.  InfoPath is a complete piece of junk when coupled with SharePoint.

February 7th, 2013 4:10pm

Hey JD,

Just to add some more insight to the lack of communication between InfoPath / SharePoint. I just had an issue where adding new data into my datasheet view caused my IE to crash. It appears that this happened because I had a people picker field that allowed for multiple selections. I created a new list and instead of using an InfoPath form, used the SharePoint form, and then put in the same people picker field allowing multiple selections. This time it worked and IE did not crash.

Free Windows Admin Tool Kit Click here and download it now
February 11th, 2013 10:43pm

The original poster doesn't need the answer anymore but I'll post the solution here just in case someone else comes looking.

This happened to me while I was using Infopath to modify a list form.  Instead of creating the control in infopth, create the field first in your data source (or create the column in sharepoint first), then drag the field from your fields list onto the form to generate the drop-down control.  If you have already created the control, you can just delete the field, then re-create it and change the binding on your existing control.

To create a field in the data source without creating a control:  http://office.microsoft.com/en-us/infopath-help/add-a-field-or-group-HP001096752.aspx

When you view the field properties, it will say ChoiceType instead of LookupType (this is not something you can change in Infopath while editing a list form but you can get around it by creating a new field yourself and selecting a data type).

Then you can set up the control properties to get choices from external data (sharepoint list).

To filter the list of choices: http://office.microsoft.com/en-us/infopath-help/filter-the-data-that-is-displayed-in-a-control-HA101783367.aspx

June 25th, 2013 7:02pm

I had this exact same issue, and I just figured out how to fix it.  Thought I'd add this solution in case it can help someone.  I had a SharePoint 2010 list, and I had customized the form in Infopath 2010.  I had a lookup column on my form that called to an external data source, and I was getting the "Only Positive Integers Allowed".  This is how I fixed it:

  1. Deleted the Lookup column in Infopath.
  2. Returned to my SharePoint list and made sure the column was removed from there as well.
  3. On my SharePoint list, I added a CHOICE field (not a Lookup), and I didn't add any choices.
  4. Then, I clicked "Customize Form" to open Infopath again.
  5. I then inserted the new choice field into my form.
  6. Selected the new field, and then clicked on "Control Properties".  Changed the data source.
  7. Published the form, and tested the field. 
  8. It worked!

Hope that helps.

Angela Hohman

  • Proposed as answer by hatfira Thursday, March 20, 2014 2:51 AM
Free Windows Admin Tool Kit Click here and download it now
September 16th, 2013 3:26pm

Angela - your answer solved my issue!  :)  Thanks!

October 23rd, 2013 5:33pm

This is a nice clever workaround - thanks for posting! One caveat though: Sharepoint doesn't maintain the data integrity of this type of worked-around lookup field like it does a standard one. So, say my lookup source list is a list of food: 1. Apple 2. Orange 3. Bananana 4. Grape

If I have grocery list X that has a standard lookup field to FoodList, and I correct the spelling of Banana, my grocery list item for Banana will automatically show the corrected spelling.

On grocery list Y that has your nice workaround to get rid of the poorly-worded validation error, the corrected spelling will not automatically show; the original value still shows.

Jim Boling

Free Windows Admin Tool Kit Click here and download it now
October 30th, 2013 9:36pm

Selena - note the warning above, just in case it affects your implementation.
October 30th, 2013 9:37pm

After tyring several solutions, this worked for me.  Thanks! 

My only issue is that I had built other columns based on the original lookup field.  This is a secondary form in my site, so I will seek a work-around for the other two look-up fields. 

Thanks Angela!

Free Windows Admin Tool Kit Click here and download it now
December 17th, 2013 9:01pm

Hi Angela Hohman,

I had exactly same issue.

I followed your approach and it seems it worked for me.

In my case i didn't delete my existing look up column. just kept there incase, if they need in future for any other reason. It worked perfectly fine. and one thing i would like to notice, when created new choice column, by default it asks for at least one choice. i kept there one value from my list, which i wanted to appear there.. Thanks for your help 

February 3rd, 2014 10:37am

The problem is that you probably added a dropdown field in InfoPath, but havent set the binding of the field. Just add a text field that should store the selected value and set the binding of the dropdown to that field and you are done.

regards,

Jran de Wit

Free Windows Admin Tool Kit Click here and download it now
March 18th, 2014 8:16am

I had this exact same issue, and I just figured out how to fix it.  Thought I'd add this solution in case it can help someone.  I had a SharePoint 2010 list, and I had customized the form in Infopath 2010.  I had a lookup column on my form that called to an external data source, and I was getting the "Only Positive Integers Allowed".  This is how I fixed it:

  1. Deleted the Lookup column in Infopath.
  2. Returned to my SharePoint list and made sure the column was removed from there as well.
  3. On my SharePoint list, I added a CHOICE field (not a Lookup), and I didn't add any choices.
  4. Then, I clicked "Customize Form" to open Infopath again.
  5. I then inserted the new choice field into my form.
  6. Selected the new field, and then clicked on "Control Properties".  Changed the data source.
  7. Published the form, and tested the field. 
  8. It worked!

Hope that helps.

Angela Hohman

 This is the perfect solution , Thanks Angela 
 Whats happening is Sharepoint list field is a look up value from the same library and what we need is a look up from a different library

March 20th, 2014 4:25pm

I had this exact same issue, and I just figured out how to fix it.  Thought I'd add this solution in case it can help someone.  I had a SharePoint 2010 list, and I had customized the form in Infopath 2010.  I had a lookup column on my form that called to an external data source, and I was getting the "Only Positive Integers Allowed".  This is how I fixed it:

  1. Deleted the Lookup column in Infopath.
  2. Returned to my SharePoint list and made sure the column was removed from there as well.
  3. On my SharePoint list, I added a CHOICE field (not a Lookup), and I didn't add any choices.
  4. Then, I clicked "Customize Form" to open Infopath again.
  5. I then inserted the new choice field into my form.
  6. Selected the new field, and then clicked on "Control Properties".  Changed the data source.
  7. Published the form, and tested the field. 
  8. It worked!

Hope that helps.

Angela Hohman

 This is the perfect solution , Thanks Angela 
 Whats happening is Sharepoint list field is a look up value from the same library and what we need is a look up from a different library


This, in my opinion, is not a perfect resolution.

Option 1: You cannot have a choice field in SharePoint list and not add any choices to it. In case you left the field as Enter Choice1, Enter choice2, Enter choice3, then added the Data connection in InfoPath form to populate this field from another list - you are going to face issue when you try to edit the list in the Data Sheet view. The Data sheet view is not going to show the lookup data that you attached in InfoPath form. If you edit the row in data sheet view, it is going to show error that the value for the field is not among the choices created. It might not be critical for everyone, but in case you need to administer or work around any scenarios that users need to correct, data sheet view is helpful. So I will choose Option 2.

Option2: If you follow the approach of creating the Drop down field in the InfoPath form and not in the list, then also there is an issue. The issue mentioned by Greg in the initial post - In the Value of the drop down if Title is selected (same as Display Name), then it shows error because internally, lookup field needs to store the ID. But some how I need this to show the Value (and not the ID) if I have to create rule on the drop down and set a field's value depending on the value selected from the drop down. So I will choose Option 1.

It's a vicious circle in my opinion. You have to choose which is better "drawback" that you can avoid. If anyone has a different opinion or resolution to this, please post here.

Free Windows Admin Tool Kit Click here and download it now
April 22nd, 2014 3:12pm

Thanks! The Choice solution really saved the day!
January 20th, 2015 10:37am

Buenas tardes

la respuesta fue muy sencilla y esta en el siguiente link:

http://www.ilikesharepoint.de/2012/07/sharepoint-2010-infopath-lookup-column-throws-only-positive-integers-allowed/

saludos

YEISSON GOMEZ MARIN

Free Windows Admin Tool Kit Click here and download it now
April 18th, 2015 1:59pm

I had the same issue.  For me, the error was that I'd drilled down into the dataFields while applying the filter!  (See screenshot).  This caused the Value and Display name one screen back to show a dot (.) in each field instead of  d:ID and d:Title.  Adjusted the filter without drilling down and now all is well.


July 31st, 2015 11:02am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics