Geeks With Blogs
Tangible Thoughts SharePoint, MOSS? and all the other questions

This is a problem I keep running into quite often and today again I spent an hour wondering why my code wouldn’t work.

What I was trying to do was to use the Lists WebService (i.e. lists.asmx) to add contents on to a WSS list via the UpdateListItems() method.

The reason for the hiccup in the code was that when trying to add a value to a field whose name consists of multiple words (for instance "Last Name") the field should be referred to with a "_x0020_" separating the words (i.e. "Last Name" becomes "Last_x0020_Name"). Actually I knew that, but it had got lost somewhere deep down in my brain and failed to be recalled when needed.

So next time if any of you are wondering why you keep getting the return value "<ErrorCode>0x81020014</ErrorCode><ErrorText>No such field name...", it could just be that field you are referring doesn’t exist or contains multiple words and needs to be referred to as above.

Posted on Wednesday, July 28, 2004 3:10 PM SharePoint | Back to top


Comments on this post: With regard to SharePoint field names

# re: With regard to SharePoint field names
Requesting Gravatar...
Grabbed for the WSS FAQ (wss.collutions.com / www.wssfaq.com) as III.88 "I'm getting ""<ErrorCode>0x81020014</ErrorCode><ErrorText>No such field name". Anyone know a cure?"

Your fame is spreading as we speak :)
Left by Mike Walsh Helsinki on Jul 28, 2004 4:27 PM

# re: With regard to SharePoint field names
Requesting Gravatar...
That is why I alsways build a DVWP listing all my lists fields...
http://www.wssdemo.com/Pages/admin1.aspx?menu=Demo's
Left by Ian Morrish on Jul 30, 2004 6:35 AM

# re: With regard to SharePoint field names
Requesting Gravatar...
Can you explain why SharePoint is adding so much funky text to the field/column names? When I use a List as a data source in a Web Part, it really looks ugly. And since the UI is all my users know and understand, they get cranky when they see _x0200_ everywhere.
Left by Tippy Turtle on Oct 19, 2005 3:12 PM

# re: With regard to SharePoint field names
Requesting Gravatar...
Well thats kinda how it is.
_0x020_ is supposed to represent the url encode %20 (aka space).
As to why exactly it is like that I am not really sure. I believe internally it has a purpose.
I would recommend you sanitizing the url encode characters before they are put in to the UI.
Here is a list of them www.blooberry.com/indexdot/html/topics/urlencoding.htm

I dont think you need to worry about all of them, coz you might not be able to create a column with some of them in Sharepoint
Left by Tariq on Oct 19, 2005 3:20 PM

# re: With regard to SharePoint field names
Requesting Gravatar...
Hi,

another thing u should test:

if ur create a user defined list, one col. called Title will be created. Sometimes user change this column name. Reading is no problem (with the SP api) with this new col.name, but writing via the batch xml webservice would throw the error mentioned above.
thats because sharepoint col. name is just 'Title'. Try 'Title' as column name!

this costs 2 hours for me ;)
Left by Adrian Bre. on May 23, 2006 11:11 AM

# re: With regard to SharePoint field names
Requesting Gravatar...
Ping back...

Thanks
Left by Derik Whittaker on Aug 07, 2007 2:27 AM

# re: With regard to SharePoint field names
Requesting Gravatar...
=Fields!ows_Project_x0020Name.Value
or =Fields!ows_Project_x0020_Name.Value

does not work ???
Left by Anonymous on Jan 13, 2008 6:46 PM

# re: With regard to SharePoint field names
Requesting Gravatar...
I have a field called

W/C

And i get the following

W%5Fx002f%5FC

any help to convert taht so i can use it in my XML would be great

thanks

ps thanks for the OP saved us very much with the spaces

Left by Chance on Jan 24, 2008 4:22 AM

# re: With regard to SharePoint field names
Requesting Gravatar...
Even reading will cause the progblem if you are accessing the column names like this spListItem["coulumname"]. This column name should be always internal name. The same can be found in a child way. Go to list settings pages and hover the mouse on the column name . It will show the internal column name as as value of "Field" query string.
Left by SharePoint on Dec 22, 2009 6:58 PM

# re: With regard to SharePoint field names
Requesting Gravatar...
nice solution, thanks a lot. im new to sharepoint web services, it gave the right way.
Left by Shanthi on Sep 14, 2011 2:48 PM

Your comment:
 (will show your gravatar)


Copyright © Tariq | Powered by: GeeksWithBlogs.net