1

Using Rules with Webform Rules enabled, how would I make a new node after a webform submission and use the submitted values as field values in the node?

In short, how do I turn webform submissions into nodes using Rules.

I've set up the Rule like this:

Rules

Where do I go from here? I can't seem to find a way to move webform submission values into the node's fields.


Please note: I have read "Using webform rules to create node after webform submission" and "How to create a node with submissions of a webform?". Unfortunately, neither address my question.

8
  • The whole point of drupal.stackexchange.com/questions/80022/… is that you do not need to take the extra step via Rules and Webforms. Create the nodes directly.
    – Jeroen
    Feb 24, 2017 at 19:09
  • @Jeroen Thank. But is it possible to do it the way I've outlined?
    – Sam
    Feb 24, 2017 at 19:13
  • Have a look at this question, and my answer to it. Not sure if your question is a duplicate of that question, but possibly my answer to that question also works for your question, no? Feb 24, 2017 at 19:29
  • @Jeroen, it's often necessary to provide a more user friendly version of a form. I tend to use a mix of node/add and entity forms. Feb 25, 2017 at 8:58
  • @Pierre.Vriens, this is the right answer. I'd add that sometimes it is necessary to force save a node after creating it in the rule for some entity reference (OG mainly) things to work. Feb 25, 2017 at 9:00

1 Answer 1

1

Below is something I learned about using webform data in Rules, which may help you to get this to work ... (assuming this question is about D7).

You have access to all labels and all values of any field of a webform, ie:

  • [data:MachineFieldName-title] contains the Label of a field with machine name MachineFieldName.
  • [data:MachineFieldName-value] contains the Value of a field with machine name MachineFieldName

So try to use similar tokens.

For way more details on this, and a prototype rule about this, refer to the answer to "How to create a node from a Webform using rules?":

  • the 1st attempt relates to using "Entity has field" (which doesn't work for Webform).
  • the 2nd attempt explains what to do in case of Webform.

Note: if your target field is a multi value field, using "Set a data value" is completely wrong. Instead you need to use an action like "Add item to a list". Refer to my answer to "How to set multiple values to an unlimited Term Refence field with Rules" for way more details about "Add item to a list".

3
  • Yeah, I think this is the missing piece. Thanks. Seems like a good place to start, anyway. What if the destination field on the node is a select list?
    – Sam
    Feb 27, 2017 at 0:28
  • Thank you for the feedback (and accept). Not sure how to correctly understand your question in your last comment. Actually what's the problem, or what's stopping you from getting that to work? Maybe it's worth posting a new question? Feb 27, 2017 at 10:27
  • This works when the destination field in the node is a text field. I have one that's a select list. The source is an identical select list in the webform, but I can't get the webform selection value populate the node's select value.
    – Sam
    Feb 28, 2017 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.