Module: 4/5
Lesson: 6/7
Exercises:
Module 4 | Lesson 5

Lesson 5: Parsing Responses — Getting the Data You Need from What You Get

Handling Missing or Null Fields

Real APIs don't always return every field. Sometimes a field is optional, and if the data doesn't have it, the field is absent or null.

Example response where the user doesn't have a phone number:

{
  "id": 123,
  "name": "Bob",
  "email": "bob@example.com",
  "phone": null
}

If your next step tries to use phone and it's null, your workflow might crash or behave unexpectedly. Solution: use a fallback value.

In Make:

{{if(item.phone; item.phone; "No phone number provided")}}

In n8n, use the expression editor:

{{ $json.phone || "No phone number provided" }}

This says: "If phone exists, use it. Otherwise, use this fallback."

🔒

This lesson is premium

Get full access to AI Workflows — all modules, all lessons, lifetime access.

Already purchased? Sign in to restore access.