0

Ok, I have a customer that is wanting to have an applicant complete a specific webform and then have their user account be assigned to a specific role automatically.

My thought was to go the following route using rules:

  1. Applicant creates their user account
  2. They are then automatically taken to the specific webform
  3. Once the webform is completed, then they are automatically assigned a specific role (this is the part where I'm lost as to the best option or if it's even possible)

Is this something that would even be possible using rules? Or are there other options that may work? Any assistance would be greatly appreciated!

I hope I've explained the situation enough :) Let me know if you need any further info.

Thank You!!

Nicole

1 Answer 1

1

Sure you can! This is a way of doing it with the Rules module.

This also requires the Webform Rules Module.

Download that, enable it, and be sure that the Rules UI module within it is enabled as well.

Step 1 - Create Rule

Start by creating a new Rule under Admin>Config>Workflow>Rules.

Name it whatever you'd like, but have it react on "After a webform has been submitted"

Create new Rule


Step 2 - Find Webform's NID

In another tab, view your Webforms in Content>Webforms. Hover your mouse over the Edit link next to the Webform you were talking about to find its Node ID (NID). You will need this in a second.

View Webforms

Webform NID


Step 3 - Only Apply Rule to that Particular Webform

Return to the Rule you created a bit ago and click the "Add condition" link under "Conditions".

Conditions

Select "Data Comparison" as your condition.

Here, you are going to select "node:nid". This is because you only want this rule to fire up when the Webform you mentioned earlier is submitted.

Below that, enter in the Node ID for the Webform

nid


Step 4 - Add Action for Adding Role

Return to your Rule and click on the "Add Action" link in the "Actions" settings.

Add Action

For your Action, you are going to select "Add user role"

User Role

Under the Data selector, you are going to choose "user"

enter image description here

Below that, select the Role(s) that you want the submitter to gain.

Hope this helps!

2
  • thank you so much for this! a couple of things... when i go to create a new rule, i'm not seeing anything re: completion of webform and i don't see an option for "add a user role "add user role"... i'm not too terribly familiar with rules, so is there something i need to do to get more items available? Here is what I see in the drop down: app.box.com/s/u6cucod1cifrgnner7pabksam16xwjse - any additional assistance would be greatly appreciated :)
    – Nicole
    Commented May 10, 2018 at 23:02
  • Hi Nicole, sorry about that! I edited my post. You need the Webform Rules Module as well for those options to be available. Hope that helps! Commented May 23, 2018 at 22:07

Your Answer

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

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