Why won't Zapier MySQL row updates set NULL values when field is empty?

I’m working with a Zapier automation that syncs data from Google Sheets to a MySQL database. The workflow has two paths - one creates new records if they don’t exist (working fine), and another updates existing records with new data from the spreadsheet.

The update process works perfectly when replacing existing values with new ones. For example, my database table looks like this:

+----------+----------------+------------------+
| record_id| user_feedback  | sheet_source_id  |
+----------+----------------+------------------+
| 1001     | positive       | 8945623789654321 |
+----------+----------------+------------------+

When the spreadsheet data changes, the MySQL record updates correctly:

+----------+----------------+------------------+
| record_id| user_feedback  | sheet_source_id  |
+----------+----------------+------------------+
| 1001     | negative       | 8945623789654321 |
+----------+----------------+------------------+

However, when a user clears the feedback field in the spreadsheet (leaving it blank), the old value remains in MySQL instead of being cleared:

+----------+----------------+------------------+
| record_id| user_feedback  | sheet_source_id  |
+----------+----------------+------------------+
| 1001     | negative       | 8945623789654321 |
+----------+----------------+------------------+

I need it to clear the field like this:

+----------+----------------+------------------+
| record_id| user_feedback  | sheet_source_id  |
+----------+----------------+------------------+
| 1001     |                | 8945623789654321 |
+----------+----------------+------------------+

After testing and contacting Zapier support, I learned that NULL values get stripped from the Python code step output. My Python code handles empty inputs like this:

# Handle missing input values
def process_input(field):
    return source_data.get(field, default_empty)

def map_fields(field_list, mapping_list):
    for target, source in zip(mapping_list, field_list):
        val = process_input(source)
        output_data.update({target: val})

sheet_fields = ['equipment_type', 'start_date', 'end_date', 'task_desc', 'vendor_name', 'status_booked', 'status_confirmed', 'job_number', 'completion_flag', 'estimated_cost', 'invoice_amount', 'invoice_ref', 'booking_ref', 'last_updated', 'feedback_notes']
database_fields = ['equipment', 'from_date', 'to_date', 'description', 'contractor', 'booked', 'confirmed', 'job_id', 'complete', 'est_cost', 'inv_amount', 'inv_number', 'book_ref', 'update_time', 'notes_feedback']

# Process all field mappings
default_empty = None
output_data = {}
map_fields(database_fields, sheet_fields)
final_results.update(output_data)

return final_results

The code runs without errors and updates work for actual values, but when fields are deleted in the sheet, old MySQL values persist. Zapier support confirmed that NULL values are stripped from the Python step output before reaching the MySQL update step.

I tried using empty strings instead of NULL but got the same result. Has anyone found a workaround for this Zapier limitation?

Yeah, Zapier’s super annoying with this. Here’s what worked for me: add a filter step before the MySQL action that converts empty fields to something like “DELETE_ME”. Then use MySQL’s NULLIF function in your update query: UPDATE table SET user_feedback = NULLIF(user_feedback, 'DELETE_ME'). Works great and you don’t need custom endpoints or scripts.

I experienced a similar issue with Zapier and MySQL integration. As you’ve identified, the platform does indeed strip out NULL and empty values before they reach the MySQL update step, which can be quite frustrating. A solution I found effective involved using a distinct placeholder, such as “CLEAR_FIELD”, in place of NULL or empty string values. When constructing the SQL update query, I utilized a CASE statement to interpret this placeholder as NULL in the database:

UPDATE table SET user_feedback = CASE WHEN user_feedback = '__CLEAR_FIELD__' THEN NULL ELSE user_feedback END.

This approach allows for proper handling of the empty fields while bypassing the NULL filtering issue with Zapier. While it does require some SQL logic adjustments, it has proven to be a consistent workaround.

This limitation drove me crazy when I built a similar sync system last year. I ended up bypassing Zapier’s MySQL action completely and used a webhook to a custom endpoint instead. Created a simple PHP script on my server that receives the POST data from Zapier and handles MySQL updates directly. Webhooks preserve all field values including empty ones, so I could detect when fields should be cleared and run the right UPDATE statements with explicit NULL assignments. Worth maintaining a small custom script vs fighting with Zapier’s field filtering. You could also try Zapier’s custom SQL action if your plan has it - sometimes handles NULLs differently than the standard update action.