How to create a match values table?

Hello. I have a case where I need to check a webhook value to determine the text output. The example is simple:

Meta ADS sends a webhook with a form ID, and I know each form ID name, but I have to insert it manually on n8n in something like a “match table”.

For examples:

If form ID is 1234, it will output “It’s a doctors’s form”
If form ID is 2345, it will output “It’s a nurse’s form”
If form ID is 3456, it will output “It’s a lawer’s form”

Basically I want to create a table “If webhook value X match Value Y, output Value Z”. where I can create multiples line like that and inset the Y and Z value manually.

Information on your n8n setup

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

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:

It depends on what you need exactly; some possible directions:

  • Set up a Google Sheets or AirTable document with the keys and values and do a lookup on these.
  • Use a Code Node where you define an array with key/value pairs and return the right one.
  • If the workflow should also differ for each ID, you can use the Switch node.
1 Like

You gave me good ideas.

  • Notion database for big tables
  • Switch node for small ones

Thanks

1 Like

Brilliant, good luck!

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