1

I have a SharePoint 2013 site with custom lists containing taxonomy columns. It had data initially. But for some requirement, I had to do a batch delete of those list items and repopulate them through an application. I also cleanup the TaxonomyHiddenList using batch delete and also remove the terms from the term store except the termsets, since the terms get dynamically created from an application. The re-population happens properly after I re-add the items and I can see them through the UI also. But when I try to read the taxonomy column values again from code after executing a CAML query, it is not throwing any exception, but at the same time, fetching blank values. I mean the taxonomy column returns 0 as count, though there is a value. Has anyone faced this issue before? If so, can you please help? This is a critical issue, blocking us from going live. So, please help ASAP.

1

Update your code to get taxonomy column value:

TaxonomyFieldValueCollection spTaxonomyFiledValueCollection = spListItem[taxonomyField] as TaxonomyFieldValueCollection;    

          foreach (var field in spTaxonomyFiledValueCollection)    
          {    
              fieldValue = field.Label;    
          }    
  • I am doing like this only. This collection is coming as blank for me (with count 0). – Ven Apr 16 '16 at 8:26
  • Are you getting values without caml query? I mean if looping of all items and check value of taxonomy column. – Viraj Gorajia Apr 16 '16 at 8:27
  • No. I am getting the items by executing the caml query only. In fact, my CAML query is filtering on the Taxonomy Field by passing the lookup id from the Taxonomy Hidden List. – Ven Apr 16 '16 at 12:31
  • Follow this link.sharepointpals.com/post/… – Viraj Gorajia Apr 16 '16 at 13:24
  • Thanks. But I had already seen this and it didn't help. – Ven Apr 16 '16 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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