1

I am trying to read Retention Label applied using REST API but unable to read tried both values, tried CAML as well but not getting this field, can we read using API or is not possible?

_api/web/lists/getbytitle('documents')/items?$Select=OData__ComplianceTagWrittenTime
_api/web/lists/getbytitle('documents')/items?$Select=_ComplianceTagWrittenTime

2 Answers 2

2

You could use FieldValuesAsText to get the Value. But this only works on a single item

/_api/web/lists/getbytitle('documents')/items(id)/FieldValuesAsText
2
  • it only work for one item right but i have to get iterate for all items
    – kumar
    Aug 22, 2020 at 7:50
  • i tired your way and able to read data by looping in Thanks for your solution it worked however need to iterate logic , but thats developer life
    – kumar
    Aug 25, 2020 at 10:04
0

Is the Graph API an option for you? You could do this with the following call:

https://graph.microsoft.com/v1.0/sites/root/lists/{id}/items?$expand=fields($select=id,_ComplianceTagWrittenTime)
1
  • graph api i cannot use any other option we have
    – kumar
    Aug 21, 2020 at 8:28

Your Answer

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

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