First of all a quick disclaimer:
I am new to the SharePoint API and the concept of managed metadata term sets, so please bear with me.
I am supporting an application (VueJS/javascript) that searches a SharePoint 2016 Server instance for documents that are categorized by Managed Metadata Set tags. The application relies on the values of these tags being setting in the hidden TaxCatchAll field, but for some reason, TaxCatchAll is not getting set upon uploading a new file into the document library. The metadata must be present, because the files are displayed as being properly categorized in the library folder listing. In some cases, checking the file out and immediately checking it back in seems to trigger an update of TaxCatchAll, but in other cases, it does not.
Here is a sample of the type of API query that the application is running:
https://XXX.YYY.ZZZ/AAA/BBB/\_api/Web/GetFolderByServerRelativeUrl('IDTEST')/Files?$select=UIVersionLabel,TimeLastModified,ServerRelativeUrl,LinkingUrl,Name,UniqueId,Properties/TaxCatchAll,ListItemAllFields/OData\_\_dlc_DocId,Versions&$expand=Properties,ListItemAllFields,Versions
In most cases, the JSON returned from the API query contains the correct TaxCatchAll tag string, e.g.
"Properties": {
"__metadata": {
"id": "https://XXX.YYY.ZZZ/AAA/BBB/_api/Web/GetFileByServerRelativeUrl('/AAA/BBB/IDTEST/REDACTED')/Properties",
"uri": "https://XXX.YYY.ZZZ/AAA/BBB/_api/Web/GetFileByServerRelativeUrl('/BBB/BBB/IDTEST/REDACTED')/Properties",
"type": "SP.PropertyValues"
},
"TaxCatchAll": "3;#Design|a33c28b5-9744-49cd-8b13-63199c342ea5;#2;#ProjNameRedacted|3b51ca68-2135-4e16-a7a0-6d5460d8ef16;#31;#Archives|0d24179e-34f0-4d3c-9392-822614829dd8"
},
However, in some cases, it returns:
"Properties": {
"__metadata": {
"id": "https://XXX.YYY.ZZZ/AAA/BBB/_api/Web/GetFileByServerRelativeUrl('/AAA/BBB/IDTEST/REDACTED')/Properties",
"uri": "https://XXX.YYY.ZZZ/AAA/BBB/_api/Web/GetFileByServerRelativeUrl('/BBB/BBB/IDTEST/REDACTED')/Properties",
"type": "SP.PropertyValues"
},
"TaxCatchAll": "13;#;#3;#;#2;#;#8;#"
},
The tags are coming from a hierarchical managed term set structured similar to the following (Actual names changed)
"TopTermCategory"
"Document Type"
"TermVal1"
"TermVal2"
...
Is there perhaps a different API query I can use to find documents with a specific managed metadata term value instead of relying on TaxCatchAll?
I am desperate to find a solution. This has been hindering progress for several weeks now.
Thanks in advance to anyone that can offer help or suggestions.