under "actions" i "add a variable" and then "show a message". in the latter i cannot find the variable token i added (in this case a simple integer to test it out) and i cannot guess the format for the insertion. please can you tell me how to add variables, lists into a message.

thanks,

laurence

Comments

Syntapse’s picture

the data selector shows as new-variable so i enter as a string: "variable value is: [new-variable]". and i get the same string displayed on the page...

Syntapse’s picture

the actual variable added was new_variable which is changed to new-variable in the Display Message action. I have tried [node:new-variable], [node:new_variable], [new-variable], [new_variable]. ????

Syntapse’s picture

Other things I have tried.... [new-variable:name][new_variable:name] ???

TR’s picture

Category: Bug report » Support request
Issue summary: View changes
Status: Active » Fixed

This works:

{ "rules_show_variable" : {
    "LABEL" : "Show variable",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "init" : [] },
    "DO" : [
      { "variable_add" : {
          "USING" : { "type" : "integer", "value" : "4" },
          "PROVIDE" : { "variable_added" : { "variable_added" : "Added variable" } }
        }
      },
      { "drupal_message" : { "message" : "Added variable = [variable-added:value]" } }
    ]
  }
}

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.