How do I enable audience targeting in custom SPFx Client Side Web Part in SharePoint Online?

Vivek Gupta 126 Reputation points
2020-08-14T03:18:13.843+00:00

Hi,

How do I enable audience targeting in custom SPFx Client Side Web Part in SharePoint Online?

Please provide a code example for it.

I have created audiences in the Audiences List under Manage Audiences in SharePoint Admin Center. However, when I enter the audience name in the Audience column in the Site Pages library for a Modern Page, message "No results found" is shown even though that particular audience has already been compiled.

Please let me know the solution for this issue.

Thanks.

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. ZhengyuGuo 10,586 Reputation points Moderator
    2020-08-14T07:08:08.88+00:00

    Hi @Jack-9275,

    You can check about this code demo to enable audience targeting in SPFX Web Part solution:

    Reusable Target Audience wrapper based on SharePoint groups for custom SPFx webparts

    Here is the full code snippet in GitHub:

    target-audience-generic-component


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.