0

My CAML query not work if it contain any "Person or Group" fields.

Here is my CAML:

<Batch OnError="Continue" ListVersion="17" PreCalc="TRUE">
  <Method ID="1" Cmd="New">
  <Field Name="Title">fff</Field>
  <Field Name="Person_x0020_or_x0020_Group">test\administrator</Field>
</Method>

Raymond
  • 175
  • 1
  • 1
  • 11

1 Answers1

1

You have to use the User ID.

<Field Name="Person_x0020_or_x0020_Group">[SharePoint User ID]</Field>
Mhd. Yasseen
  • 1,027
  • 3
  • 16
  • 27
  • you can get the user ID from the user name by another method. – Mhd. Yasseen Apr 28 '13 at 06:33
  • @Mhd.Yasseen is correct - SP requires the User ID when inserting/updating Person or Group fields via CAML. You can easily obtain the User ID from the login (e.g. domain\username) by querying the site users. – Stevangelista Jun 25 '17 at 19:23