Extract data from a webhook and insert it into a database

I would like some guidance on how to extract an email address from the body of a webhook and compare it to an email address in a firestore database, if they match, copy an id from the webhook data and
save it in the users database in a specific field

Information on your n8n setup

Debug info

core

  • n8nVersion: 1.56.2
  • platform: docker (self-hosted)
  • nodeJsVersion: 20.15.0
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: community
  • consumerId: unknown

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: memory

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

Generated at: 2024-09-08T22:16:12.759Z

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

What you want to do here is send your Webhook and Firebase data into a merge on email_address, and then use a Set node to filter out just the fields you want (email_address, id, and whatever you want).

I’m not 100% sure if the Get option in Google Cloud Realtime Database node allows for query by email, if not, you will have to use a HTTP Request node using your Firebase credentials and input the query using cURL syntax.
Once you have the merged data, you just have to push it back to Firebase like so:

Jay, you are a star. I will check this out on the weekend and let you know how it went!

1 Like

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