Hello everyone,
I am very new to this automation with n8n.
I am frustrated with getting n8n, 360Dialog and Supabase to work correctly.
I am trying to have n8n check if a number is in my supabase data base, if it is not, it will then proceed to add it.
I am using a Webhook with my 360dialog information, Edit fields to label the phone number to $json.phone, and an HTTP request to do the checking in Supabase.
The problem starts here; no result is returned, and it halts.
If I instruct the HTTP node to always return a result even if empty, I have an IF node that checks if the $json object is empty.
When this is true, it goes to the HTTP request that has the credentials of my supabase, it then stores information… but the phone number field from before is empty.
Additionally, I have to set the IF node always return data, as it will halt like it did before with the HTTP node.
Logically, I do not see it should not work. If I hardcode my phone number, it works and saves the information. The HTTP node checked if the number is in the database and only returns a value when it finds it. Otherwise, it returns nothing and I lose access to everything I had in the webhook. The Edit Fields no longer persist.
Edit:
Even if I place ‘{{$json.body.entry[0].changes[0].value.contacts[0].wa_id.trim()}}’ in the node to insert the value, it does not carry over. Why is this happening what am I missing?