Show certain elements based on URL query string I am very new to drupal and also very willing to learn.
I am trying to migrate old code from another tool to drupal 8.
I am working on a form, using the webform module.
Can I possibly show certain webform elements based on specific URL query strings?
Example:
test.com?user=employee, then show TextField = employee ID
test.com?user=customer, then show Textfield = Company name.

Any help would be greatly appreciated.
You can create a hidden element called 'user' which can be prepopulated via the URL, then this hidden element can be used to conditionally hide/show other elements and even the submit button.

Below is the YAML source for a proof-of-concept.

user:
  '#type': hidden
  '#title': user
  '#prepopulate': true
customer_name:
  '#type': textfield
  '#title': 'Customer name'
  '#states':
    visible:
      ':input[name="user"]':
        value: customer
    required:
      ':input[name="user"]':
        value: customer
employee_name:
  '#type': textfield
  '#title': 'Employee name'
  '#states':
    visible:
      ':input[name="user"]':
        value: employee
    required:
      ':input[name="user"]':
        value: employee
actions:
  '#type': webform_actions
  '#title': 'Submit button(s)'
  '#states':
    visible:
      - ':input[name="user"]':
          value: customer
      - or
      - ':input[name="user"]':
          value: employee


Personally, I would change the 'user' from a hidden element to a select menu, just-in-case someone navigates to the form without any query string parameters, they would still be able to select the 'type of user'.