Skip to content

[BUG] Get-PnPListItem -List $list not returning all fields on items when list has many fields #4164

@nozzrangar

Description

@nozzrangar

Reporting an Issue or Missing Feature

It looks like Get-PnPListItem does not return all fields on items when there are many fields in the list, when you fetch all list items by only providing the -List Parameter

ListA has 222 fields based on Get-PnPField -List $listA
ListB has 112 fields based on Get-PnPField -List $listB

$allItemsListA = Get-PnPListItem -List $listA
$singleListItemListA = Get-PnPListItem -List $listA -Id 104

$allItemsListB = Get-PnPListItem -List $listB
$singleListItemListB = Get-PnPListItem -List $listb -Id 41

Expected behavior

$allListItemsListA[1].FieldValues.Count should be the same value as $singleListItemListA.FieldValues.Count
$allListItemsListB[1].FieldValues.Count should be the same value as $singleListItemListB.FieldValues.Count

Actual behavior

For ListA that has 222 fields:
$allListItemsListA[1].FieldValues.Count only shows 192 FieldValues.
$singleListItemListA.FieldValues.Count shows all FieldValues, or 202 FieldValues.

image

For ListB that has 112 fields:
$allListItemsListB[1].FieldValues.Count shows all FieldValues, or 92.
$singleListItemListB.FieldValues.Count also shows all FieldValues, or 92.

image

Steps to reproduce behavior

# ListA has 222 fields.
$allListItemsListA = Get-PnPListItem -List $listA -PageSize 1000
# allListItemsListA[1] is the same item as $singleListItemListA
$allListItemsListA[1].FieldValues.Count

# singleListItemListA is the same item as allListItemsListA[1]
$singleListItemListA = Get-PnPListItem -List $listA -Id 104
$singleListItemListA.FieldValues.Count

# ListB has 112 fields. 
$allListItemsListB = Get-PnPListItem -List $listB -PageSize 1000
# allListItemsListB[1] is the same item as $singleListItemListB
$allListItemsListB[1].FieldValues.Count

# singleListItemListB is the same item as allListItemsListB[1]
$singleListItemListB = Get-PnPListItem -List $listB -Id 41
$singleListItemListB.FieldValues.Count

What is the version of the Cmdlet module you are running?

2.5.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions