I want to load all FieldValues for a specific ListItem


  public ListItem GetItemById(List SPList, int id, string[] fieldNames)
            using (Ctx)
                ListItem item = SPList.GetItemById(id);
                if (fieldNames != null)
                    foreach (string field in fieldNames)
                        Ctx.Load(item, i => i[field]);
                //Tried below line, doesn't work
                //Ctx.Load(item, i => i.FieldValues);            
                return item;

So in above example i am passing the field names to load, however i want all fields to be loaded.


According to my research, List.GetItemById will naturally return all the fields of the item as well as their values, while other methods of getting a list item will not.

For example: List.GetItemById Will Return Item with All Fields

|improve this answer|||||
  • No it doesn't load all values – Kunal Valecha Jul 1 '16 at 12:07

None of the existing answers worked for me. This does:

CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = string.Format("<View Scope=\"RecursiveAll\"><Query><Where><Eq><FieldRef Name='ID' /><Value Type='Number'>{0}</Value></Eq></Where></Query></View>", itemId);
ListItemCollection collListItem = list.GetItems(camlQuery);
      items => items.Include(
          item => item.Id,
          item => item.DisplayName,
          item => item.HasUniqueRoleAssignments,
          item => item.Folder,
          item => item.File,
          item => item.ContentType


|improve this answer|||||
  • that would work if it was my answer ;) – Nicholas DiPiazza Aug 13 '19 at 12:31
  • Why are you loading collListItem twice? – Emaborsa Mar 5 at 9:45
  • i believe that is a typo. but i don't have an environment handy to test if that's true or not. – Nicholas DiPiazza Mar 16 at 20:42
  • I dont think it is a typo, because the first line loads all fields, the second one just the "included" ones – Emaborsa Mar 16 at 20:53

The following CSOM worked from my desktop. Change parameter as needed...

Import-Module ‘C:\Program Files\Common Files\microsoft shared\SharePoint Client\Microsoft.SharePoint.Client.dll’

$site = 'https://inside.nov.com/mfg/QC'
$context = [System.Net.CredentialCache]::DefaultNetworkCredentials
$context = New-Object Microsoft.SharePoint.Client.ClientContext($site)
$context.Credentials = $credentials
$list = $context.Web.Lists.GetByTitle('Report Issues')
$ListItems = $List.GetItems([Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery()) 

write-host "Total Number of List Items found:"$ListItems.Count

# get required fields from this list

$fields = $list.Fields

foreach ($field in $fields)
    if($field.Required -eq $true)
       write-host $field.Title
       #write-host $field.InternalName
       #write-host $field.StaticName
|improve this answer|||||

try this

var item = list.GetItemById(id);
|improve this answer|||||
  • No field values are loaded this way. – Shai Petel Aug 2 '19 at 16:30

One should try following code

var item = list.GetItemById(id);

This will load all the fields of the given list item.

|improve this answer|||||
  • 2
    It seems that a list item in this context does not have a Fields collection so it can't be loaded this way. – Colin Gardner Apr 15 '18 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.