Sometimes when I enter a search term into Bing or Google, I get the feeling that the Internet is laughing at me. Earlier this week, one of my coworkers uploaded a document to SharePoint. The document had been created from a document library’s “New” option, which is associated with a Word template. He had been working on the document while traveling, and encountered a peculiar problem when he returned to the office. He could save the document in the library, but when trying to change a Choice field, he received an error: “Invalid Lookup value”. We couldn’t see any metadata in the Word document that would seem to be a problem, but when we deleted all the metadata in the document and uploaded it again, the problem went away.
Since creating this library, along with its content types and workflows, we have had a few odd problems. Sometimes, a document can be created but it can’t be saved. Word tells us that there is a piece of required metadata that is empty. Of course, we can see all the required fields and they are set to valid values. If we save the document locally and then upload it to SharePoint, the upload works fine. We explain the situation to the user, but our explanations always end up including phrases like “it seems like”, “we think”, and “all indications are” and I hate having to do that!
We have assumed, and when the Internet isn’t laughing, “search results would indicate” that the problem is related to the fact that SharePoint metadata is stored in Word documents even when they are taken out of SharePoint. That feature isn’t the problem, but if changes are made to the library settings, we might encounter problems when trying to bring the document back into the library or run a workflow that involves those columns. Since we can’t actually debug this – if you really want the Internet to laugh, search for combinations of “SharePoint Designer” and “Debug” – we are left with trying various possible scenarios as we log whatever information we can. Our library includes Managed Metadata, Calculated columns and Lookup columns so we thought that they represented good candidates. Our testing shows that Word and SharePoint can actually handle changes related to these column types quite well. I even went so far as to store a document off-line with data in a Choice column. I then deleted the Choice column and created a required Lookup column with the same name, but where the values did not match those in the Choice column. I uploaded the document and SharePoint simply set the Lookup column to “none”.
I had hoped to blog about debugging and investigation techniques today, but we haven’t been able to come up with anything better than what has already been suggested in other blogs; we certainly haven’t found a solution. If we ever manage to unearth the activity or combination of activities that cause these errors, I’ll l pass the information along here. Until then, we will remind our users to save their documents to local drives when they can’t save them to SharePoint. We will make sure they know how to remove the metadata from an Office document, and we will be careful to test changes we make to metadata columns. We will keep trying to recreate errors, and to examine the documents that cause them, but I expect to continue to hear the Internet laughing.