InfoPath forms error – one of the most obscure I’ve ever seen…

I had an InfoPath web form configured, working well, and ready to deploy.  I let my colleague know about it and when he tried it out a day or two later, he was getting an error message I hadn’t myself seen:

Warning

There has been an error while processing the form.

Click Continue to resume filling out the form. You may want to check your form data for errors.

Click Start Over to load a new copy of the form.

Show error details

When I browsed the Details of the error message, InfoPath Forms Services showed me this:

An error occurred accessing a data source.

An entry has been added to the Windows event log of the server.
Log ID: 5566

Not much help there, but I kept trying to figure this out.  I tried from different browsers (same error) and from different PCs (still same).

I got the bright idea to check the settings in the Data Connection in the InfoPath template I’d designed, but everything looked the same – even the URL that I was using to retrieve an XML representation of the List data (according to this helpful blog entry on “Accessing SharePoint List Data as XML” and “Populating form data from SharePoint List Views”).  However, when I tried completing the Data Connection wizard for this existing connection, I was getting blasted with this error:

The file is not a valid XML file.
The file is not a valid XML document.
A document must contain exactly one root element.
  Line 1, Position 0

I wondered if I’d messed up the permissions on the List, so I verified that I and my colleague had Read & Contribute permissions (so the Form would load), and I even added back the “System Account” with its Limited Access (using the “trick” documented in this blog article).  Still nothing.

When I tried to load that URL in a browser, the page it returned was blank, and even when I looked at the View Source, there wasn’t anything helpful there:

I retried this over and over for a few days, re-examining the URL in the Data Connection, triple-checking the GUIDs (thinking they must’ve gotten changed somehow during a recent tweak to the List), and wondering what I’d done wrong (or what had gotten horked up on the servers).

And the Solution Is…

Eventually I tried some googling on “A document must contain exactly one root element”, and finally returned to my old friends, the InfoPathDev.com and SharePointBlogs.com sites.  When I arrived back at the “Accessing SharePoint List Data as XML” article, one of the comments jumped out at me:

I can’t get this to work on a List that contains a Lookup field.  I just get a blank page in the browser. Have you encountered this too? Any ideas?

Bingo!  One of the recent tweaks I’d made was to convert a field in the list from using the “Choice” data type to the “Lookup” data type.  (Note: using a Lookup to a separate List enables me to delegate maintenance of that list of Choices to my team members, without asking them to muddle around in the bowels of my List’s Column settings.)

All I had to do was to remove the one Lookup field from the View I was retrieving in this Data Connection, and the web Form started working again (without any changes or re-Publishing necessary, even!).  I even confirmed that the URL, when used in a browser, would return a readable XML document (though you have to View Source on the returned page, which looks just as blank in IE8 as the failing one).

Lesson: if you’re going to leverage SharePoint Lists as XML data sources in your InfoPath Forms, make sure that the View you select does NOT include a Lookup field.  I told you this was obscure…

Categories XML

Obama White House – starting to feel a lot like Christmas

I’m getting awfully excited about the team that Obama is building. Biden’s track record & poise, the behind-the-scenes bulldog who’s going to be chief of staff, Clinton’s abilities/intelligence, Richardson’s sheer ability to articulate… It’s like the Bizarro world version of the Bush White House.

Especially after the past two years’ painfully-drawn out campaigning, the forced antagonism, the hyper scrutiny of every little difference between presidential candidates. Now, to see some of the strongest, smartest Democratic candidates all coming together to form such a solid team – it’s like this is the reward for sufering the last couple of decades of rampant Republican deconstructivism.

Actually, the first thought when I realized that we had these five (and others) I’m the same cabinet was, “this is starting to make me think of The West Wing [the fantasy White House that most of us had wished was really running the country]” – above all, with more collected intelligence and good intentions than I could’ve hoped would come together to lead this country.

I’ve been saying for the last couple if years that I’d be happy with a president that accomplished exactly *nothing* during their term, after the retarded clearcutting & international embarrassment of the tenure of the Connecticut Chimp. Now I’m actually looking forward to not just a period of healing from the road rash W has left behind, but real improvement in the lives of significant numbers of people (both inside and outside the US) that really *need* the help [instead of just lining the pockets of those who’ve already enriched themselves at the expense of the hard workers whose backs bore the burden of the conquistadors].

I’m not quite retardedly naive to think this will be a scandal- or failure-free era, but it’s awesome to not have to grit my teeth every time the president is about to open his mouth and prove how “special” he really is.