How to user IF or Switch with empty value?

Describe the issue/error/question

Hi, how can I use properly the IF or SWITCH when the JSON response is empty?

What is the error message (if any)?

I am using a IF and also tried with switch to create a path according to a “SET” action result, the thing that is happening is, that even if the response is empty, it still recognizes as giving a results, so how can I set properly the if or the switch to recognize the response is empty valued?
As you can see in the screenshot I tried using a condition String with “Is not empty”, but it the result is still true instead of false.

Thank you very much.

Please share the workflow

(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)

## Share the output returned by the last node
<!-- If you need help with transforming the data, please also share the expected output -->

## Information on your n8n setup
- **n8n version:**  0.201.0
- **Running n8n via [Docker, npm,, desktop app]:** Docker

I believe Value 1 is checking the array parent [ ]and not the child { }.
Replace the variable in Value 1 with the { } nest instead and let me now if that works.
If not, paste your workflow here I’d be able to help you better.

See my workflow image for example:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.