In Rules, how can I use a set the value of a taxonomy term reference field to multiple values? How can I set a taxonomy term reference field to two values using Rules?  The "Number of values" for the field is already set to two.

I set up a workflow in rules that works for setting a single value.  I tested this several times and encountered no problems.  However, when I changed the "Number of values" for the field from "1" to "2" and then edited the action to add two terms instead of just one, I got the following error message:


  
  Warning: Missing argument 2 for taxonomy_options_list() in
  taxonomy_options_list() (line 1375 of
  /srv/bindings/e87a1e62cfd24fea9dd67cfd074d146c/code/modules/taxonomy/taxonomy.module).
  Warning: Missing argument 3 for taxonomy_options_list() in
  taxonomy_options_list() (line 1375 of
  /srv/bindings/e87a1e62cfd24fea9dd67cfd074d146c/code/modules/taxonomy/taxonomy.module).
  Warning: Missing argument 4 for taxonomy_options_list() in
  taxonomy_options_list() (line 1375 of
  /srv/bindings/e87a1e62cfd24fea9dd67cfd074d146c/code/modules/taxonomy/taxonomy.module).
  


When I attempt to set a value by triggering the rule, it fails and the rules debug log has the following output:


  
  3.235 ms Unable to get a data value. Error: Invalid data value given. Be sure it matches the required data type and format.
  4.254 ms Unable to evaluate action data_set.
  


What is the correct way to assign two terms at once to a single taxonomy term reference field?
As it turns out, this is actually fairly easy to do in Rules.  By updating to the latest version of the Entity API (rc3-- I was stuck on rc1 due to a different bug that I resolved earlier today) with Rules 2.1, I was able to do this in the following way:


Choose the action "Set a data value".
Choose the taxonomy term reference field to set.
Control-click to select the taxonomy terms to add.


That's all there is to it, but there is one potential gotcha: these values didn't always save correctly for me.  This may be because I opened multiple tabs in Firefox and tried to save many different rules at once; for whatever reason, sometimes only one of the two values got saved.  I fixed this by simply checking all the values again manually and re-saving them until the values stuck.