0

I'm trying to do an application which writes in another sharepoint list Today, I have a new trouble, if my column contains some spaces, my program returns me : Column does not exist So here an example: I have a column name: My setting values, if I want to write in this, I use this piece of code:

                   oListItem[variable.FieldNameTarget] = variable.FieldValue;
                   oListItem.Update();

So I know that SharePoint replace space by x0200, so before to reach this piece of code, I use:

  foreach(var item in m_objProjectList)
            {
               item.FieldNameTarget=item.FieldNameTarget.Replace(@" ", "_x0020_");
            }

But now, I have an error message:column "My_x0200_setting_x0200values" doesn't exist, so is there another way to achieve that?

Thank for your help

Arozora
  • 47
  • 6

1 Answers1

1

I would suggest that first find the internal name of the column and then use that.

You can find the internal name of any Felds using C# code as well.

This is shown here

Aakash Maurya
  • 8,481
  • 4
  • 42
  • 74
  • 2
    Thank you for your answer I think it's because my name is too long: I use the name: Synchronise with your new sharepoint list, but when I check in my internal name, I just have: Synchronise%5Fx0020%5Fwith%5Fx0020%5Fyour%5Fx0020%5Fne So my problem could come frome here?

    *Edit** After a quick search: SharePoint name for a list is limited to 32 characters

    – Arozora Jul 04 '19 at 13:03
  • That a good finding. here are some reference for future readers. http://benhuang.blogspot.com/2009/08/32-character-limit-in-sharepoint-lists.html and https://sharepoint.stackexchange.com/a/113007 – Aakash Maurya Jul 05 '19 at 05:33