using this REST API /_api/web/lists/GetByTitle('Mobile Device Request Form')/items(1473) will not retrieve all the fields

john john 946 Reputation points
2021-09-18T20:45:58.72+00:00

I have the following list inside a SharePoint Online list:-

133210-fields.png

but when i tried to query an item using HTTP request, using this url

https://****.sharepoint.com/sites/HomeOffice/en-ca/Forms/_api/web/lists/GetByTitle('Mobile%20Device%20Request%20Form')/items(1473)  

I got the following fields:-

odata.metadata  "https://****.sharepoint.com/sites/HomeOffice/en-ca/Forms/_api/$metadata#SP.ListData.MobilePhoneRequestListItems/@Element"  
odata.type  "SP.Data.MobilePhoneRequestListItem"  
odata.id    "77a6dff1-1534-4a3a-a5be-f9e5c3d8d103"  
odata.etag  "\"4\""  
odata.editLink  "Web/Lists(guid'7496e28b-e4eb-4cb8-bc0f-0a86ad91a5c3')/Items(1473)"  
FileSystemObjectType    0  
Id  1473  
ServerRedirectedEmbedUri    null  
ServerRedirectedEmbedUrl    ""  
ContentTypeId   "0x0100DD475B74D28CF446871E14C6742F3268"  
Title   null  
ReadConfirmation    false  
ComplianceAssetId   null  
CostCentreId    null  
Status  "Pending Approval"  
DeviceOwnerId   741  
DeviceOwnerStringId "741"  
PhoneNumber "TBD"  
DeviceId    27  
DeviceOwnerDisplayName  "Todd Pedersen"  
ManagerId   777  
ManagerStringId "777"  
New_x0020_Workflow    
Description "Request type: Replacement (damaged)"  
Url "https://****.sharepoint.com/sites/HomeOffice/en-ca/Forms/_layouts/15/wrkstat.aspx?List=7496e28b-e4eb-4cb8-bc0f-0a86ad91a5c3&WorkflowInstanceName=249108d5-4b5c-4914-8e6d-e15a9c9ca9e8"  
RequestType "Replacement (damaged)"  
AuthorId    4038  
Created "2021-09-18T17:09:35Z"  
Modified    "2021-09-18T17:10:25Z"  
Mobile_x0020_Device_x0020_Arriva    null  
MasterListID    null  
DeviceCost  409.99  
DamagedNotes    null  
RepairCost  null  
ReplacementCost null  
AcceptCost  false  
AccountHolder   "ah"  
AccountNumber   "an"  
MobileCarrier   "mc"  
MobileNumber    "ntbp"  
DeviceReturned  false  
PortingOver true  
RepairOption    null  
DeviceIDText    null  
CostCentreID    null  
ID  1473  
EditorId    4038  
OData__UIVersionString  "4.0"  
Attachments false  
GUID    "21bab1fc-2fa2-4dd9-b18f-7deab0978ae7"  

where the lookup field named "Cost Center" is missing can anyone advice on this please?

Thanks

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,702 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,016 Reputation points
    2021-09-20T01:38:08.293+00:00

    Hi @john john ,

    For lookup field in rest api, by default we will get lookupId.

    In your scenario, the internal of the name of the field "Cost Centre" is CostCentre. So in the result, CostCentreId is your lookup field.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful