Jun 02 2021 03:00 PM - edited Jun 04 2021 12:39 PM
We're building an SPX App to update audiences for documents stored in a library. We use modern audience.
We have succeeded with the following PowerShell approach (but we need the SPFx option for the app):
Set-PnPListItem -List $listName -Identity 5 -Values @{"_ModernAudienceTargetUserField" = "18"}
Both Audiences ( _ModernAudienceTargetUserField) and IdAudiences (_ModernAudienceAadObjectIds) is updated with valid data.
However, we were unsuccessful when trying to update data in _ModernAudienceTargetUserField or OData__ModernAudienceTargetUserField from SPfx code.
Is this type of approach even expected to be supported?
What is the expected structure of the obect for Audience column?