វិធីមួយ ដើម្បី ធានា data quality គឺ ការ បន្ថែម constraints ទៅ data fields ក្នុង form ។ Constraints ជួយ ការ ពារ users ពី ការ ដាក់ ចម្លើយ invalid ។

  1. បន្ថែម column ថ្មី ហៅ “constraint” ទៅ form ។
  2. ក្នុង column “constraint”, ដាក់ formula ដែល បញ្ជាក់ ដែន កំណត់ ។

ឧទាហរណ៍

nameconstraint
Income. >= 0 & . <= 1000000

Hard constraint

hard constraint block form submission ទាំង ស្រុង ប្រ សិ ន បើ value ដែល បញ្ចូល មិន satisfy expression ។

typenamelabelconstraintconstraint_message
integerageAge of respondent. > 0 and . <= 120Age must be between 1 and 120
decimaltemperatureBody temperature (°C). >= 35 and . <= 42Temperature must be between 35°C and 42°C
textphonePhone numberregex(., '^[0-9]{10}$')Enter a 10-digit phone number

Multiple conditions

  . >= 0 and . <= 100
  

ការ ប្រើ regex() សម្រាប់ pattern validation

typenamelabelconstraintconstraint_message
textemailEmail addressregex(., '^[^@]+@[^@]+\.[^@]+$')Enter a valid email address

ការ reference fields ផ្សេង ក្នុង constraint

typenamelabelconstraintconstraint_message
integerend_yearEnd year. >= ${start_year}End year must be after start year

Soft alert

soft alert ព្រមានដ ល់ enumerator ថា value មើល ទៅ unusual ប៉ុន្ដែ អនុញ្ញាតឱ្យ proceed ។

typenamelabelrelevant
integerchildrenNumber of children
notechildren_warningWarning: You entered ${children} children. Please confirm this is correct.. > 15
triggerchildren_confirmConfirm the number of children is correct${children} > 15
តើទំព័រនេះមានប្រយោជន៍ទេ?