title: How to Post Multi-select Values to SugarCRM via Rest API?
body: <p>Anyone have knowledge on how to insert multiple value from a multiselect input in a form via sugar's REST API v4. I haven't found any documentation on this.  The following inserts 1 value correctly but I'm stuck on saving multiple values:</p>
  
  <pre><code>function getSugar($method, $parameters){
      $url = 'https://****.sugarondemand.com/service/v4/rest.php';
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_POST, true);
      curl_setopt($curl, CURLOPT_HEADER, false);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $json = json_encode($parameters);
      $postArgs = array(
           'method' =&gt; $method,
           'input_type' =&gt; 'JSON',
           'response_type' =&gt; 'JSON',
           'rest_data' =&gt; $json
            );
      curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
      $response = curl_exec($curl);
      if (!$response) {
           die("Connection Failure.\n");
       }
       $result = json_decode($response);
       if ( !is_object($result) ) {
           die("Error handling result.\n");
       }
       if($method == "set_entry" || $method == "login"){
           if ( !isset($result-&gt;id) ) {
                die("Error: {$result-&gt;name} - {$result-&gt;description}\n.");
           }
           $id = $result-&gt;id;
           return $id;
        }else{
           if ( !is_object($result) ) {
               var_dump($response);
               die("Error handling result.\n");
            }
            return true;
       }
  }
  
  $x = "ABC";
  $parameters = array(
      'session' =&gt; $sessionId,
      'module' =&gt; 'Leads',
      'name_value_list' =&gt; array(
           array('name' =&gt; 'programs_c', 'value' =&gt; $x),
           ),
   );
   $method = "set_entry";
   $leadID = getSugar($method, $parameters);
  </code></pre>
  
  <p>The field "programs_c" is a custom multiselect field in sugar with several dropdown values. I've tried running a for-each loop but that only inserts the last value.  I've also attempted nearly every possible variation of inserting an array within the array without any success.  Any help is much appreciated!  I've spent hours trying to figure this out.  Thanks in advance for any insight / direction on how to handle this.</p>