0

My list name is 'EmployeeData' and in that list my lookup column name is 'SectorId' and that column actual name is 'Sector'.

I want title of that lookup column:

https://site name /_api/web/lists/GetByTitle('EmployeeData')/items?select=SecotrId/Title&$expand=SectorId&$Filter=UserId%20eq%20%276%27

but I can't get the data.

I also tried: Sector/Title$&expand=Sector but it's showing same error "the sectorId" query field is not valid.

1
  • I think there is a typo as you mention your field name is SectorId and in query you are using SecotrId/Title Commented May 2, 2023 at 5:44

2 Answers 2

0

You have to use the internal name of your column in SharePoint REST API endpoint.

Check this article to find the correct internal name of your column: How to find the Internal name of columns in SharePoint Online?.

Assuming internal name is Sector, you have to use endpoint like:

/_api/web/lists/GetByTitle('EmployeeData')/items?select=Title,Sector/Title&$expand=Sector&$Filter=UserId eq '6'
0

You can refer to the following api to get lookuo column

/_api/web/lists/getByTitle('List2')/items?$select=Title,lookup/Title&$expand=lookup  

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.