InfoPath DropDown List doesn't match on items in list
When populating InfoPath DropDown lists with values and then binding the dropdown to a field in your main datasource you'll sometimes see the bound value instead of its corresponding text value in the dropdown on load. It seems slightly confusing given that the entry containing your bound value is actually in the list, but it doesn't match.
Most likely this is a string casing problem. I've got a dropdown bound to a Sharepoint (WSS) UserGroup service and bind the value to @LoginName. These values are typically DOMAIN\login.name. My main datasource however, lowercases all reference variables to avoid any confusion. Since I don't control the formatting done by the Sharepoint service my best bet is to lowercase the values of the @LoginName attributes in my secondary datasource.
Since I query my UserGroup service on form load, and this occurs before the Load event in script I was able to perform toLower (or more precicely toLowerCase()) in the load event like this:
var objXMLNodes = XDocument.GetDOM("UserService").selectNodes(//@LoginName);for(i = 0; i < objXMLNodes.length; i++)
objXMLNodes(i).text = objXMLNodes(i).text.toLowerCase();