Creating a refiner for Audience Targeting labels in SharePoint

When creating search experiences, the built in refiner “Audiences” returns a GUID, which is useful if you want to match the results with {User.Audience}. I.e. “(ModernAudienceAadObjectIds:{User.Audiences} OR NOT IsAudienceTargeted:true)”, which should return items audience targeted to the current user, as well as results that are not audience targeted at all.

But back to the topic. In order to display the label of audience targeted items, you need to map the crawled property ows__ModernAudienceTargetUserField to a RefinableString and reindex the sites that use Audience Targeting. Simple as that. This could be implemented as a custom refiner in the OOTB News Search or in a custom solution like PnP Modern Search.

Now you can create a search experience with a refiner for Audience Targeting, which is really useful for scoping news posts in a tenant.

Screen shot from PnP Modern Search that displays Audience Targeting with the label instead of a GUID.



Leave a Reply

Your email address will not be published. Required fields are marked *