I am working on a workflow to display the tables and the data inside a table from postgres database. The objective is to receive the schema name and table name from postman (will pass these values as Params in the GET request) and to use these values in the query.
eg: If I want to run the query select * from information_schema.tables where table_schema=‘schema’ , I have to receive the schema-name from postman.
How can I achieve this in n8n. Can I utilize the query parameter feature of the node?
What I suspect is happening here is that your first PostgreSQL node returns more than one item, meaning your expression won’t work anymore beyond the first item (since your are referring to items from the Webhook node which has only one item).
So you’d need to find out what you want to do here. If the second PostgreSQL node (“Postgres1”) only needs to run once (for the first item), just enable the respective setting:
If you want it to use each input from the first PostgreSQL node (“Postgres”), you’d need to make sure your expressions refers either to its own input data or to a node with the same number of items. For example like so:
Hi.
Thank you for the detailed explanation. I have enabled the execute once option and it works fine.
I have one more doubt. Say I want to choose a value from the input data of the node, like the image you have shared (you have selected migration). The input data is displaying only the first row , with its column values. If I want to select data from some other row, how can I achieve this (say row num 3) ?
This is not currently possible through the expression editor as it just previews the first item. You could manually write an expression including $item to reference a specific item though.