I created a registration form where the user can select their role from a dropdown list. I was directed to this page to get the code to Set User Role: https://docs.gravityforms.com/gform_user_registered/
All I’ve done so far is add that code into my funtions.php file and update the form field ID in the code to match what I have on my form. I’ve created my feed and I’m seeing the submissions with the role they selected in the form. However, when I activate the user, their role is not set. Is there anything else I need to add or change? What am I missing? Thank you in advance.
Hi Joseph. This is the example to follow to allow your visitor to select a role in the form, and use that role in the User Registration feed:
Are the roles in your dropdown in the form exactly the same as the roles as you have defined them for you users? Without seeing the form or how your roles are defined, it’s hard to confirm.
Thank you for the reply Chris.
Yes, the link I provided earlier is the same as what you referenced. All I did was copy that code for “Set User Role” and paste it into my functions.php file. I also changed in the code the field ID to reflect the role field I have on my registration form.
Here’s my form: Nursing Ed Registration – HCA Nursing Education
And I’ve checked and made sure the roles match up.
Hi Joseph. I think based on this information I recommend opening a support ticket. That way you can send your system report and we can dig further into it. Thank you.
My issue has been resolved through support.
The problem is that I created the new roles through a plugin and the names had / in them and so gravity form did not recognize them. I had to show value and use the slug names generated by the plugin. Once I did those, it worked perfectly.