0

I have the following columns inside a SharePoint Online list:

enter image description here

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?

1 Answer 1

1

You have to expand the lookup & person or group columns to get more details out of these columns like:

https://****.sharepoint.com/sites/HomeOffice/en-ca/Forms/_api/web/lists/GetByTitle('Mobile Device Request Form')/items(1473)?$select=*,CostCentre/Title&$expand=CostCentre

With simple API endpoint like below only returns the ID of item selected from lookup list:

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

In your case, it is CostCentreId. This is already returned in the response you added to your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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