Troubleshooting Guide
Solutions for common issues in FluidForms
This guide provides solutions for common issues you might encounter while building forms in FluidForms. It covers problems with Liquid templating, conditional logic, integrations, and more.
General Debugging Tips
When your form isn't behaving as expected, start with these general debugging techniques.
1. Use Preview Mode Extensively
Preview mode is your first line of defense. Test your form thoroughly after every significant change. Fill out fields with different values to test all possible paths and edge cases.
2. Use the Browser Developer Tools
Your browser's developer tools (usually opened with F12 or Ctrl+Shift+I) are invaluable. The Console tab will show you any JavaScript errors that might be breaking your form's functionality.
3. Output Values for Debugging
A powerful way to inspect the state of your form is to temporarily output values directly into a paragraph or text field.
DEBUG: {{ email }} - {{ age }}
This will display the current values of specific fields, helping you see exactly what data your logic is working with.
Common Liquid Issues
Syntax Errors
- Problem: Using
{{ }}for logic tags instead of{% %}. - Incorrect:
{{ if age >= 18 }} - Correct:
{% if age >= 18 %}
Forgetting to Close Tags
- Problem: An
if,for, or other block is not closed, causing rendering to fail. - Incorrect:
{% if condition %} ... - Correct:
{% if condition %} ... {% endif %}
Incorrect Variable Access
- Problem: Trying to access a form field value using the deprecated
valuesobject. - Incorrect:
{{ values.email }} - Correct:
{{ email }}
Missing Default Values
- Problem: A calculation fails because a field is empty (
nilornull). - Incorrect:
{{ price | times: quantity }} - Correct:
{{ price | default: 0 | times: quantity | default: 1 }}
String vs. Number Issues
- Problem: Trying to perform math on a value that is a string.
- Solution: Liquid automatically handles type conversion for basic math operations. However, if you need to ensure a value is treated as a number (e.g. for strict comparisons), you can add 0.
- Example:
{% assign numeric_value = "5" | plus: 0 %}
Conditional Logic & Navigation
Logic Not Triggering or Field Not Hiding
- Check Field Names: Ensure the field name in your Liquid expression is the static name set in the properties panel, not the label. Field names are case-sensitive.
- Verify the Logic: Double-check your
ifcondition. Use debug output to see the exact value you are checking against. - Boolean Logic: For hidden properties, ensure your expression correctly returns
true(to hide) orfalse(to show).
Navigation Not Working
- Check Section Names: The name returned by your Liquid expression in the "Go To Section" property must exactly match the target section's name (case-sensitive).
- Test All Paths: Make sure every possible outcome of your Liquid expression corresponds to a valid section name. An expression that returns an invalid or empty name will break navigation.
- Ensure a Path to "Thank You": All logical paths must eventually lead to a section with
mode: "thankyou".
Integration & Webhook Problems
Webhook Not Firing
- Check the URL: Verify that the URL is correct and publicly accessible. Use a tool like RequestBin or webhook.site to test if the endpoint is receiving requests at all.
- Check Server Logs: If you are hosting your own endpoint, check your server logs for incoming requests.
Authentication Errors
- Problem: Your endpoint returns a
401 Unauthorizedor403 Forbiddenerror. - Solution: Currently, FluidForms webhooks do not support custom authentication headers. Ensure your endpoint is accessible or uses a secret token in the URL query parameters (e.g.,
https://api.example.com/webhook?token=SECRET).
Performance Issues
Slow Form Loading or Calculations
- Problem: The form is slow to respond, especially when filling out fields that trigger Liquid calculations.
- Solution: Optimize your Liquid code.
- Avoid Repeated Calculations: If you use the same complex calculation multiple times, compute it once and store the result in a variable using
{% assign %}. - Minimize Loops: Nested
forloops can be slow. Try to use array filters likemaporwhereto process data more efficiently.
- Avoid Repeated Calculations: If you use the same complex calculation multiple times, compute it once and store the result in a variable using
Example: Inefficient vs. Efficient Calculation
Inefficient:
Subtotal: {{ price | times: quantity }}
Tax: {{ price | times: quantity | times: 0.1 }}
Total: {{ price | times: quantity | times: 1.1 }}
Efficient:
{% assign subtotal = price | times: quantity %}
Subtotal: {{ subtotal }}
Tax: {{ subtotal | times: 0.1 }}
Total: {{ subtotal | times: 1.1 }}
