I have added my List as a webpart to a web page, and I set a specific 2 target audiences for it (Owner, Customer). However, now I would like to use C#, JS, REST to get assigned audiences from list or web part.
Please help. Thanks
I have added my List as a webpart to a web page, and I set a specific 2 target audiences for it (Owner, Customer). However, now I would like to use C#, JS, REST to get assigned audiences from list or web part.
Please help. Thanks
This behavior is set on the AuthorizationFilter property of the Web Part itself. You can see an example of that here: https://sharepoint.stackexchange.com/questions/138566/adding-target-audiences-programmatically
You'll need to use the WebPartManager to get ahold of the WebPart on the page that you care about so that you can inspect it. You'd then use the AudienceManager's helper methods to parse out the AuthorizationFilter's value to turn it into human readable groups and audience names.