Create an Action on 'node_insert' or 'node_presave' I created a new action on a new node being created, it shows up in my triggers and the action gets triggered. Works so far. Problem is trying to add additional functionality using some submitted field values. As of now, all its doing is logging in Watchdog. My goal is to be able to set a flag on the node based on certain values.

------------------------------------------------------------------

/**
 *  Implementation of hook_action_info().
 */

function my_custom_action_info() {
  return array(
    'my_custom_action' =&gt; array(
  'type' =&gt; 'node',
  'bundles' =&gt; array('article'),
  'label' =&gt; t('Check article for stuff'),
  'configurable' =&gt; FALSE,
  'triggers' =&gt; array('node_insert'),
    ),
  );
}

function my_custom_action($node) {
    $myvar = $node-&gt;nid;
    my_custom($myvar);
}   

function my_custom($myvar) {
    watchdog('Test', 'My Custom Variable: ' . $myvar);
}


--------------------------------------------------------------------------

If I set the variable to an integer or text, it works.
But how to get any value from the submitted node?
Eventually I'd like to get a value from a specific field, but for now just testing with the Node ID and can't seem to get it.

The error I'm getting is :
"Notice: Trying to get property of non-object in my_custom_action() ... "

This part: $myvar = $node->nid;
yeah,

for some reason, my variable needed to be initiated first.

$myvar = 0;
$myvar = $node-&gt;nid;


that's it. works now.
Problem/solution applies for Drupal 6 or 7.