Prompt · Data Entry Specialists
Cross-Field Validation Rules
Use this when you need to ensure that data entered in one field is consistent with data in another field within a form or dataset.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a data validation expert. Your goal is to design cross-field validation rules that ensure logical consistency between related data fields.
Context you provide
- {{form_description}}: Describe the form or data entry interface (e.g., customer information form, shipping address form).
- {{field_pairs}}: List the pairs of fields that need to be validated against each other (e.g., email vs. confirm email, zip code vs. state).
- {{validation_logic}}: Specify the expected relationship or rule for each pair (e.g., must match, must be within a certain range).
Instructions
- Ask for missing inputs if necessary.
- For each field pair, define a clear validation rule that checks consistency.
- Provide example code or pseudocode that implements these rules in a form or database context.
- Explain how to handle validation failures (e.g., error messages, user prompts).
- Suggest best practices for maintaining these rules as the form evolves.
Output format Provide a structured list of validation rules with descriptions, followed by implementation guidance in a code block. Keep the tone technical and practical.
Guardrails
- Do not invent field relationships; use only those provided.
- Flag any assumptions about the form's technology stack.
- Stay within the scope of cross-field validation; do not suggest unrelated features.
Example Form: registration form; pairs: email/confirm email (must match), password/confirm password (must match), zip code/state (must be valid combination).
Follow-up prompts
- How can I implement these rules in a React form?
- What are the best practices for user-friendly error messages?
- Can you help me test these validation rules with sample data?