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.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,823 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerryzy 10,566 Reputation points
    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