Error message that field or property does not exist in the list while it exists by calling Rest API with "fields"

Jane Ayano Jackson 10 Reputation points
2024-01-18T12:57:24.7166667+00:00

Dear staff,

I tried to use https://<site url>/_api/web/lists/getbytitle('<list title>')/items?$select=Title,Topic/Title&$expand=Topic to call API to retrieve json file with the real value instead of numeric value of Topic this field. However, I got an error that The field or property 'Topic' does not exist.
And I tried to get the field names by "https://<site url>/_api/web/lists/getbytitle('<list title>')/fields" and it returns that Topic is the internal name.

<d:EntityPropertyName>Topic</d:EntityPropertyName>
<d:Filterable m:type="Edm.Boolean">true</d:Filterable>
<d:FromBaseType m:type="Edm.Boolean">false</d:FromBaseType>
<d:Group>Custom Columns</d:Group>
<d:Hidden m:type="Edm.Boolean">false</d:Hidden>
<d:Id m:type="Edm.Guid">1cdda84a-b295-45fb-975c-f2eb8dfbe705</d:Id>
<d:Indexed m:type="Edm.Boolean">false</d:Indexed>
<d:InternalName>Topic</d:InternalName>
<d:JSLink>SP.UI.Taxonomy.js|SP.UI.Rte.js(d)|SP.Taxonomy.js(d)|ScriptForWebTaggingUI.js(d)</d:JSLink>
<d:PinnedToFiltersPane m:type="Edm.Boolean">false</d:PinnedToFiltersPane>
<d:ReadOnlyField m:type="Edm.Boolean">false</d:ReadOnlyField>
<d:Required m:type="Edm.Boolean">false</d:Required>
<d:SchemaXml>
<Field Type="TaxonomyFieldType" DisplayName="Topic" List="{a85d168d-85e4-4160-9328-23842bf82add}" WebId="57966b90-f250-4795-9a8f-14175932b190" ShowField="Term1033" Required="FALSE" EnforceUniqueValues="FALSE" ID="{1cdda84a-b295-45fb-975c-f2eb8dfbe705}"

Could you please help me on this matter to get json file with real value in "Topic"?

Thanks!

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,287 questions
{count} vote

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 38,956 Reputation points Microsoft Vendor
    2024-01-19T08:50:07.63+00:00

    Hi @Jane Ayano Jackson, If you want to get the expand properties such as term text, you can use TaxCatchAll in REST API to get the Managed Metadata column values. This field exists for all rows having taxonomy data, and includes all the terms used.

    /_api/web/Lists/GetByTitle('<list>')/Items/?$select=*,TaxCatchAll/Term&$filter=TaxCatchAll/Term eq 'Topic'&$expand=TaxCatchAll
    

    Check this blog to get more details.

    ---If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.