0

Is it possible to get and/or set the List Settings > Audience targeting settings > Enable audience targeting on or off with the Sharepoint REST API?

I've tried checking the GET <web-url>/_api/Lists(guid'<list-id>') response of the same list before and after toggling the setting, but the only things that changed was the odata.etag, the CurrentChangeToken and the LastItemModifiedDate.

1 Answer 1

1

It is not a property of the list class. If the "Enable audience targeting" is checked, the list will have a field with Type="TargetTo" Name="Target_x0020_Audiences" DisplayName="Target Audiences" guid "61cbb965-1e04-4273-b658-eedaa662f48d".

You can check the fields for the list fields using API "/_api/Lists(guid'<list-id>')/fields". You will find this field only if the audience targeting is enable.

For example:

enter image description here

To enable/disable audience targeting for this list, you may need to add/remove this field to/from list using REST API.

How to manage list using REST API.

Here is a demo about how to enable or disable Audience targeting of a list in SharePoint using CSOM (just for your reference):

Your Answer

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

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