Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
titleProfile (profile2)
var profile2 = {
  "user" : 1,
  "label" : "Profile",
  "type" : "profile",
  "field_first_name" : "Tom",  // A text field
  "field_middle_name" : "Stewart",
  "field_last_name" : "Baker",
  "field_profile_location" : {  // An address field
    "street" : "1520 Locust Street",
    "additional" : "Suite 1000",
    "city" : "Phila",
    "province" : "PA",
    "postal_code" : "19102",
    "country" : "us",
  },

// The field types below are not used in the main profile, but may be used in additional profile types
// They are listed here for reference

  "field_text_area" : {  // A text area field
    "value" : "this is the summary<b>This is bold</b>", // Basic HTML structure is supported
    "format" : "filtered_html" // Text format is a required field. All users have access to Filtered HTML
  },

 "field_boolean" : 1,  // A single on/off checkbox or radio button selection

 "field_collection": {  // A field collection
        "id": 1234  // This is the id of the field collection on the profile. 
    },
    "field_name_of_board": "ABIM", // This is just an example. Check your site to confirm field names and values.
    "field_board_id": "848309583", // This is just an example. Check your site to confirm field names and values.
    "field_name": "field_board_certification",  // Example name of the field collection
    "host_entity": { // host_entity is the Form ID of the profile form to update.
        "id": 4567,
        "resource": "profile2"
    }

 "field_checkbox_select" : {  // A multi-select box or group of checkboxes
    // The first key in this array is the language selection, which defaults to 'undefined'
   "und" : {
      // Using the keys found in the field Allowed Values configuration
     "option_one",
     "option_two",
    },
  },

};

...