Skip to content

Get-MgSiteListItem - Not returning all field names but mapping these to field_<nn> #2976

@gjhardie

Description

@gjhardie

Describe the bug

I'm trying to retrieve a SharePoint List using:
$items = (Get-MgSiteListItem -ListId $listID -SiteId $siteId -ExpandProperty "fields" -All).Fields.AdditionalProperties
When we return the keys for the list using: $Items[0].keys
This returns:
@odata.etag
Title
field_0
field_2
field_3
field_4
field_5
field_6
field_7
field_9
field_10
field_12
field_14
field_15
field_16
field_19
field_22
field_24
LinkTitle
RegulatedSystem
LinkTitleNoMenu
ContentType
Modified
Created
AuthorLookupId
EditorLookupId
_UIVersionString
Attachments
Edit
ItemChildCount
FolderChildCount
_ComplianceFlags
_ComplianceTag
_ComplianceTagWritten

Expected behavior

Expected to return:
IT Service Ref
Application Reference
Status
etc.

How to reproduce

$items = (Get-MgSiteListItem -ListId $listID-SiteId $siteId -ExpandProperty "fields" -All).Fields.AdditionalProperties
$Items[0].keys

SDK Version

2.23.0

Latest version known to work for scenario above?

This is first attempt

Known Workarounds

It's possible access the SharePoint List from a browser, to identify which fields fields_ are mapped to.

Debug output

Click to expand log ```
</details>


### Configuration

Name                           Value                                                                                                                                                        
----                           -----                                                                                                                                                        
PSVersion                      5.1.22621.4111                                                                                                                                               
PSEdition                      Desktop                                                                                                                                                      
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                      
BuildVersion                   10.0.22621.4111                                                                                                                                              
CLRVersion                     4.0.30319.42000                                                                                                                                              
WSManStackVersion              3.0                                                                                                                                                          
PSRemotingProtocolVersion      2.3                                                                                                                                                          
SerializationVersion           1.1.0.1        

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions