Show/Hide Form Fields Based On User's Country

This guide will explain how to show or hide form fields for users from a specific country/region.

1. Add User Country Via The Users Page:

image
  • Click “Edit” under the down arrow in the “Quick Actions” column.
image
  • Update the Country option.
  • Save the changes.
image

2. Initial Form Setup:

  • Drag and drop a “Text” and two “Field Update Workflow” fields.
  • Rename the fields as needed.
  • Note- Here, we are using a “Text” field to pre-fill the user's country on the form. You can use a “Hidden” field instead of a “Text” field.
image
  • Drag and drop some additional fields to show/hide on the form based on the user’s country.
  • Rename the fields as needed.
image
  1. Configuring The First “Field Update Workflow” field:
  • Click the pencil icon of the first “Field Update Workflow” field.
  • Set “Field Updates Success” as ‘User's Country || value || {{Formyoula_User_Country}} ’
  • It will prefill the “Text” field named “User's Country” with the value of the user's country on the User’s Details Page.
  • Save the changes.
image
  1. Configuring The Second “Field Update Workflow” field:
  • Click the pencil icon of the second “Field Update Workflow” field.
  • It will show/hide the additional form fields based on the pre-filled “User’s Country” field's value.
  • Set “Rule Criteria”-
    • User’s Country || equals || US
image
  • Set additional form field in the “Field Updates Success”-
    • Address || Hidden || false
    • Phone Number || Hidden || false
    • Email ID || Hidden || false
image
  • Set additional form field in the “Field Updates Fail”-
    • Address || Hidden || true
    • Phone Number || Hidden || true
    • Email ID || Hidden || true
  • Save the changes.
image
  1. Test The Form:
  • It will prefill the “User’s Country” field on page load.
  • It will show the additional form fields if the “User’s Country” field value matches the second “Field Update Workflow” field “Rule Criteria”.
image
  • Otherwise, it will hide the additional form fields.
image

For any questions, please contact us - [email protected] or the Formyoula in-app chat. 🙂