msgraph-sdk-powershell
msgraph-sdk-powershell copied to clipboard
Get-MgSiteListItem does not return Number field value
List items with all the field values can be received by executing
Get-MgSiteListItem -SiteId $SiteiD -ListId $ListId -All -ExpandProperty Fields
However, when a SharePoint list field is a Number type, the returned value is empty. Changing the field type in SharePoint to Singe line of text the correct value is returned.
Module: Microsoft.Graph.Sites Module version: 1.9.2
@Attila-FIN, this works on my end without any issue. From my testing, it looks like the service won't return a field if it has no value:
This is the result of $ListItems[0].Fields.AdditionalProperties when having the columns as single line of text:
In SharePoint it looks like this:
If I change the columns to Number, the result in PowerShell:
In SharePoint it looks like this:
If I change back to text, the column values are available in PowerShell.
This behavior is still not reproducible using the latest version of the module.
Steps followed:
-
Add PostCode column of single line of text type to a list item. PostCode is returned in
AdditionalProperties
as string: -
Change PostCode column to Number. PostCode is returned in
AdditionalProperties
as single:
Please use -Debug
switch to confirm that the field is included in the response from the service.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
I am experiencing the exact same thing. I am on the newest version of Graph.