Skip to main content

How to Hide Salutation by Country

Learn how to dynamically show or hide the salutation field based on the user's selected country in Formulayt.

Updated over 9 months ago

Benefits of dynamic field display

Showing and hiding fields dynamically offers several advantages:

  • Decreases form friction by reducing visible fields

  • Increases completion rates with simpler forms

  • Collects more relevant data based on user context

  • Improves overall user experience

Remember: Only ask for information you actually need from your web users.
​

Hide salutation by country rule setup

This rule bundle shows the salutation field only for countries where it's culturally relevant (like the United Kingdom).
​

Rule configuration steps

1. Set the trigger type

Set this rule to run continuously because:

  • The salutation field is visible to users

  • Its value can change in real-time as users interact with the form

2. Define the conditions (IF)

Set the following condition:

  • Field: country

  • Condition: is in

  • Value: GB,DE

This checks if the selected country is either United Kingdom (GB) or Germany (DE) using their two-digit ISO codes in a comma-separated list.

Note: If you're targeting just one country, you could use the "equals" condition instead.
​

3. Configure the actions (THEN)

When the condition is met:

  • Action: Show field

  • Field: salutation

4. Add otherwise actions

Add an "Otherwise" action to handle when countries outside your target list are selected:

  • Action: Hide field

  • Field: salutation

This ensures that if a user changes their country from GB/DE to another country (e.g., US), the salutation field will be hidden again.
​

Best practice tip

Place the country field at the top of your form type. This creates a better user experience because:

  • The salutation field will appear below the country field

  • Users won't see fields suddenly appearing above where they're currently typing

  • The form flow feels more natural and responsive

Did this answer your question?