0

Normally you access a field using jslink in the following manner:

ctx.CurrentItem.Title

but how can I access Audiences field for a given item? This does not seem to work:

ctx.CurrentItem["Target Audiences"]

How can I loop through the target audiencies field and display its values using jslink?

  • I think audiences are not supported in the SharePoint client object model. Its only supported in the Server Object Model. – Amit Kotha Sep 25 '15 at 13:08
  • how can I use target audiences in content query web part? – Burre Ifort Sep 25 '15 at 13:27
0

You can access Target Audiencies like:

var groupNames; 
groupNames = oListItem.get_item('Target_x0020_Audiences').split(',');

then you can loop groupNames with comma(,) separated.

  • how can I apply this to ctx.CurrentItem? – Burre Ifort Sep 25 '15 at 13:59
  • Use ctx.CurrentItem["Target_x0020_Audiences"] – Ronak Patel Nov 18 '15 at 8:33
  • you cannot access them using ctx.CurrentItem["Target_x0020_Audiences"]. I have tried that before, but does not work. – Burre Ifort Nov 19 '15 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.