Answers.Body: <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T17:36:19.240Z
Answers.Text: I'm sure I tried that and it didn't work but now it seems to. I must not have had something right.  Thanks
Answers.UserDisplayName: Paul-Tahoe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-30T10:19:27.343Z
Answers.Text: @Paul-Tahoe No problem, could have been cached or something :D
Answers.UserDisplayName: EagleUK
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T09:20:48.007Z
Answers.LastActivityDate: 2019-09-27T09:20:48.007Z
Answers.UserDisplayName: EagleUK
Answers.Body: <p>In your webform, add a hidden field called Role</p>
  
  <ul>
  <li>set the default value to the token <code>[current-user:roles:first]</code> </li>
  <li>set the type to 'Hidden element'  (Secure value looks like it should work but didn't in my test.)</li>
  </ul>
  
  <p>Then on the Conditionals tab add the rule:</p>
  
  <pre><code>If Role is anonymous user
  then Contact1: Existing Contact isn't shown
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T17:41:34.810Z
Answers.Text: 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.
Answers.UserDisplayName: Paul-Tahoe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T22:56:30.540Z
Answers.Text: That’s awesome Aiden!
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T09:12:34.987Z
Answers.LastActivityDate: 2019-09-27T09:12:34.987Z
Answers.UserDisplayName: Aidan
Body: <p>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.</p>
  
  <p>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.</p>
  
  <p>Is there a way to change the behavior and visibility of that box based upon role. </p>
  
  <p>Right now I have two almost identical webforms.  </p>
  
  <p>We also use the same webform as a link in email with the cid and key for users to update their info.</p>
  
Tags: <webform-civicrm>
Title: Is there a way to use the same webform for anonymous submission and for back office queries, i.e. hide existing contact box for anonymous
ThreadText: # Is there a way to use the same webform for anonymous submission and for back office queries, i.e. hide existing contact box for anonymous
  
  (Asked by: username_0 on 2019-09-27)
  
  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.
  
  **Tags:** webform-civicrm
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-09-27. Score: 2
  
  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.
  
  > **Comments:**
  > **username_0**: I'm sure I tried that and it didn't work but now it seems to. I must not have had something right.  Thanks  
  > **username_1**: @username_0 No problem, could have been cached or something :D  
  
  ---
  
  ### Answer by username_2 on 2019-09-27. Score: 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
  
  ```
  
  > **Comments:**
  > **username_0**: 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.  
  > **username_3**: That’s awesome Aiden!  
  
  ---
  
  