I can't figure out how to make the IF condition right => specify that only webform-client-form-155 on node 55, may fire this rule. At this moment my rule fires on the submit of every webform on my site. Hope someone can help me out?

{ "rules_aanmelding_informatieve_bijeenkomst" : {
    "LABEL" : "aanmelding_informatieve_bijeenkomst",
    "PLUGIN" : "reaction rule",
    "WEIGHT" : "1",
    "TAGS" : [ "aanmelding", "informatieve bijeenkomst" ],
    "REQUIRES" : [ "webform_rules", "php", "rules" ],
    "ON" : [ "webform_rules_submit" ],
    "IF" : [
      { "webform_has_id" : {
          "form_id" : "webform-client-form-155",
          "selected_webform" : { "value" : { "webform-client-form-155" : "webform-client-form-155" } }
        }
      }
    ],
    "DO" : [
      { "php_eval" : { "code" : "php_code to execute" } }
    ]
  }
}
CommentFileSizeAuthor
#3 webform_rules-new_condition.jpg47.63 KBstborchert

Comments

everkuil’s picture

Update: Must be webform-client-form-155 on node 155 and not node 55, sorry.

mjpa’s picture

Set the form_id to "webform-client-form-[node:nid]". The code appears to check that the evaluated value you give for form_id is in the webforms selected from the list.

stborchert’s picture

StatusFileSize
new47.63 KB

Switch to "data selection" and enter "form_id" (if its not there automatically). This will cause Rules to use the form id of the submitted webform for comparison with the id of the selected form.

everkuil’s picture

Status: Active » Fixed

"Switch to data selection and enter form_id" etc. works like a charm.
A picture is worth a thousand words.

Thanks for your answer and your work for this nice module.

Erik

Status: Fixed » Closed (fixed)

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

technikh’s picture

#3 works great. Thanks stBorchert