title: How do I update an XProfile “checkbox” type field via BuddyPress API?
body: <p>I’m working on a mobile app to interface with a BuddyPress 9.0.0 website via the BP API. The website has some xprofile parent fields of the “checkbox” type, each with a set of “options” which the user can set to be true or false. For example, there is a parent called “Pets” under which the user can select one or more of the specified check boxes such as “Dog”, “Cat”, “Cow”, etc.</p>
  <p>I am having trouble trying to update this type of “checkbox” field using Postman. The update works fine for fields of type “textbox” and “selectbox”, but doesn’t work for the “checkbox” type.</p>
  <p>The endpoint is “/buddypress/v1/xprofile/&lt;field_id&gt;/data/&lt;user_id&gt;” (POST operation, here the field_id I am using is the id of the parent field)</p>
  <p>The JSON in the body of my call is</p>
  <pre><code>{ “context” : “edit”, “value”: [“Dog”, “Cat”]}
  </code></pre>
  <p>As mentioned before, if I try the same post call with a field of type “textbox” or “selectbox”, it works fine, but if I post to a “checkbox” field it just clears the existing data and does not set it to the new values.</p>
  <p><a href="https://i.stack.imgur.com/XZgZH.png" rel="nofollow noreferrer">Here is a screenshot of Postman when trying to update a &quot;textbox&quot; field</a> (successfully updates)</p>
  <p><a href="https://i.stack.imgur.com/zz5Uu.png" rel="nofollow noreferrer">Here is a screenshot of Postman when trying to update a &quot;checkbox&quot; field</a> (doesn't update, just clears the existing data instead)</p>