I've created fairly length webform that we use for registration and getting interest. People can either fill it out online or via a paper form that the back office then enters.

For the back office I want the existing contact box so they can query up existing contacts. For anonymous users that box is confusing as they can't do anything with it.

Is there a way to change the behavior and visibility of that box based upon role.

Right now I have two almost identical webforms.

We also use the same webform as a link in email with the cid and key for users to update their info.

2 Answers 2


In your webform, add a hidden field called Role

  • set the default value to the token [current-user:roles:first]
  • set the type to 'Hidden element' (Secure value looks like it should work but didn't in my test.)

Then on the Conditionals tab add the rule:

If Role is anonymous user
then Contact1: Existing Contact isn't shown
  • Cool. I like this. Your answer is just what I asked for and I will probably use it for something. The other answer does what I needed for this case.
    – Paul-Tahoe
    Sep 27, 2019 at 17:41
  • That’s awesome Aiden! Sep 27, 2019 at 22:56

All you should have to do is edit the webform component field. Go to the 'Private' checkbox and tick it. Then only users who can access the field will be people who can access the webform results, which should only be your back office staff.

  • I'm sure I tried that and it didn't work but now it seems to. I must not have had something right. Thanks
    – Paul-Tahoe
    Sep 27, 2019 at 17:36
  • @Paul-Tahoe No problem, could have been cached or something :D
    – EagleUK
    Sep 30, 2019 at 10:19

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.