XForms home

Products

3


XForms Mobile

Mobile forms for field data collection

Mobile App

Form Designer

Dashboard

APIs & Integrations

Use Cases

Pricing

Start free trial →



CX2

Commissioning completions, rebuilt · Coming 2027

Mobile app

Completion

Add-ons

Punchlist & reports

Setup

Hand-off

Compare

Early access

Request early access →



XDocs

AI documents, from proposal to final report

Field app

AI writing

Report builder

Workload & review

How it works

Solutions

Compare

Join the waitlist →

NOT SURE WHERE TO START?

Compare the three products side by side

See which one fits your team, or talk to us and we’ll point you to the right tool.

Compare products →

Talk to us →

Resources

3

LEARN

Blog

Product news, how-tos and field stories

Customer stories

How field teams use XForms

Example use cases

Inspections, audits, sampling and more

GET HELP

Support center

Guides, FAQs and login links

XForms Mobile support

XForms Cx support

XDocs support

Contact us

WHAT’S NEW

Release notes

Every update to XForms Mobile and XForms Cx, newest first

LATEST FROM THE BLOG

Illustration of a tracked route with location pins and completed checklist items

Tracking waste from cradle to grave using smartphones + AI

All posts →

About

Log in

3

LOG IN TO

XForms Mobile

XForms Cx

XDocs

Contact us
XForms
  • Products
    • XForms Mobile
    • CX2
    • XDocs
  • Resources
    • Blog
    • Customer stories
    • Support center
  • About
  • Contact
  • Log in
    • XForms Mobile login
    • XForms Cx login
    • XDocs login
Blog/XForms Mobile/Conditional validation for your mobile forms

Conditional validation for your mobile forms

XForms Mobile

If you have a form that has some fields in it that only need to be filled out if another field meets a certain condition, then you can do this in XForms using the conditional validation attribute.

XF

XForms team

Aug 7, 2023

Conditional validation for your mobile forms

ON THIS PAGE

No headings found in this post.

    SHARE

    IF {field_1} = “value x”, THEN {field_2} “IsRequired”

    The above is a representation of a conditional validation statement.  In simple terms, this feature is used whenever you have a form that has some fields in it that only need to be filled out if another field meets a certain condition.  For example, maybe you have a checkbox field, and if its checked, then the user is required to fill out some other areas of the form.  However, if its unchecked, the user can skip those other areas.

    You can do this with any field type, not just checkboxes.  For example, you could create a validation where if a text field (or numeric field) has a value of X, then require the user to fill out the others fields, otherwise don’t require those fields.

    Here’s an example of what that looks like in the mobile app.  In the example below, if you check that checkbox on the left side of the screen (were any issues observed at any of the properties in the neighborhood), then the user will not be able to submit the form until they select a value from the “properties with issues” multiselect listbox or fills out the table below it.  And if the user leaves that checkbox blank, then the user will not have to fill out the other fields mentioned.

    XForms mobile app form where a field becomes required based on a checkbox answer

    Syntax and attributes of this feature

    The syntax of this expression is as follows:

    “requiredWhen”: “field_id~operator~value“

    The “requiredWhen” setting is a 2 or 3-part statement in the following format:

    “field_id~operator” or “field_id~operator~value”

    field_id: ID of the field to compare with

    value: the value to compare the field (above) with. This could be a single number or string, or a list of values (optional)

    Operators:

    You can compare against a specific value or range of values using the following operators:

    • checked : checks if the checkbox with specified ID is checked.
    • unchecked : checks if the checkbox with specified ID is unchecked.
    • = : checks if the value of the field is equal to one of the items in the value list.  Example: cityField~=~’Boston’,’Chicago’
    • <> : checks if the value is not equal to the value in the field
    • < : for numeric fields…checks to see if the value is less than the value in the field
    • > : for numeric fields…checks to see if the value is greater than the value in the field
    • >= : for numeric fields…checks to see if the value is less than or equal to the value in the field
    • <= : for numeric fields…checks to see if the value is greater than or equal to the value in the field
      ​

    Here’s an example:

    “requiredWhen”: “issues_yn~checked”

    In the example above, there is a field (issues_yn) .  The validation control is checking to see if that checkbox field is checked.

    All of this may seem a bit complicated, and yea, its more complicated-looking that we’d like. A future release will make this easier to use.  For now, suffice it to say that if you have some conditional validations you need on your form, it can be done.

    Want to give XForms a try?

    Click/tap the button below.

    Contact Us

    TRY XFORMS

    Wanna give it a try, risk-free?

    Build a form, capture a record offline and see it land in your dashboard.

    Start free trial
    Talk to us

    XF

    WRITTEN BY

    XForms team

     

    Keep reading

    ← Back to all posts

    Tracking waste from cradle to grave using smartphones + AI

    XForms Mobile

    Sep 5, 2025

    Tracking waste from cradle to grave using smartphones + AI

    How do you ensure that the decarbonization end-product you are paying top dollar for originated from actual waste, and not virgin material?

    Read more →

    Photos in table rows

    XForms Mobile

    Mar 2, 2025

    Photos in table rows

    Now you can take a photo within a table grid row, enabling you to take pictures of something specific and relevant to the information in that row of your table.

    Read more →

    Photo metadata improvements

    XForms Mobile

    Jan 6, 2025

    Photo metadata improvements

    Photo metadata is now captured at the photo level instead of at the form level. This enables viewing of the geolocation of each photo taken, which could differ for each photo captured on the same form.

    Read more →

    NEWSLETTER

    Get new posts in your inbox

    Product updates, field-tested how-tos and customer stories from XForms Mobile, Cx and XDocs.

    New blog newsletter signup

    One email when we publish. Unsubscribe anytime. or request a demo →

    XForms logo

    Field data, commissioning completions and AI documents for teams who work on site. XForms LLC — Raleigh, NC & Bellevue, WA.

    

    XFORMS MOBILE

    Overview

    Mobile App

    Form Designer

    Dashboard

    Pricing

    Support

    Help center

    

    CX2

    Overview

    Mobile app

    Completion

    Add-ons

    Punchlist & reports

    Setup

    Compare

    Early access

    Support

    

    XDOCS

    Overview

    Field app

    How it works

    Solutions

    Compare

    Support

    COMPANY

    About

    Blog

    Support center

    Help center

    Contact

    Privacy Policy

    Terms of Service

    © 2026 XForms LLC. All rights reserved.

    Privacy Policy · Terms of Service