Show/hide fields or sections based on user role

To add to the conditional logic functionality it would be amazing if there was an ability to show/hide fields based on user role. ie: admin, editor, etc.

Usage case – Someone is registering for an event. They log in to RSVP and depending on the user type they are shown various fields that only their role should see.

How to get around this as of now – when a user logs in have a custom redirection based on the user type to 1 of several forms -or- they have to select which type of registrant they are manually to then trigger the conditional logic.

Thank you for considering this!

1 Like

Will this approach work for you?

https://gravitywiz.com/gravity-forms-conditional-logic-based-on-user-login/

1 Like

Looks like using any value which GF now supports might work… however it would be nice have it built-in to display a drop down… Show/hide field if user role = x

Thanks for the tip.

So… what would you put in the “default value” field in the hidden field to trigger another field to be visible for say, all admin roles?

That Gravity Wiz solution only works specifically for logged in or not. If you have a small number of admin users, you could have the conditional logic rules to be

ANY
If logged in username is chris
if logged in username is support
if logged in username is kevin
if logged in username is gravity

THEN show the field. If you have a lot of admin users or the users change frequently you’ll need another approach. Let us know what you need specifically. It’s not a built in feature, but it should be possible to create something.

@ryan99 OR you probably could use advanced conditional logic by McDonnell NZ.
Link is here : [https://mcdonnell.nz/product/gravity-forms-user-role-conditional-logic/]

1 Like

The above link is the type of thing that OP was asking for @chrishajer. To be honest it’s something I’ll almost certainly require in the future, too.

One of the big hinderences to large organisations using gravity forms is that you’re not a well known vendor in the enterprise environment. I can get around this often enough by pointing to the regular updates, support team, etc. But when it comes to adding a $15 plugin from a single developer to add functionality like “If in Role, then display something”, then I have little chance of getting that through. Much better if the GF team could build that functionality in.

3 Likes

Is putting the role in a hidden field here a secure route? As users can edit values from the hidden field?

1 Like