0

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
1

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

/_api/web/lists/getbytitle('documents')/items(id)/FieldValuesAsText
| improve this answer | |
  • it only work for one item right but i have to get iterate for all items – kumar Aug 22 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 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)
| improve this answer | |
  • graph api i cannot use any other option we have – kumar Aug 21 at 8:28

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.