How to map csv row to db ? using Agent?

Can it be or must normally mapping it?
eg. many columns in csv but using prompts to get only some columns and exactly place it into PostgreSQL schema.table_name
fit it intelligently using ai?

Hey, if I understand well, you have, for exemple, a csv with those columns : name, age, location, etc…
And you want to place age into your table at the desired column ?
Or each of your csv has unconsistant different columns from each other that you want to map into a unified table ?

yes to be exacted it’s leads from difference sources now I have to map it to PostgreSQL schema.table using logic but I wonder if Agent can get it done for me easily if not (yet) fine I’ll keep moving

What you could do is convert your csv to json → ask your Agent to map the right columns to the right table scheme → replace the json columns names according to the created mapping between original columns and scheme → insert data into your PostgreSQL table.

You certainly would need to do some formatting in the data if you need before inserting them, and some kind fallback if the AI is unsure to what to make correspond, but I think it’s pretty doable !

Let me know if this helps :slight_smile:

Thanks, I’ll keep you posted.

obviously setting it wrong

I did a little example for you where the columns mismatch of the csv mismatch the schema :

After that you can easily insert your data in your db, let me know if you need further help ! :slight_smile:

2 Likes

thank you very much for your example it’s doable as you mentioned but performance I still preferred logical nodes if only check email already existed or not please correct me if I am wrong

Yes you can combine that with logic beforehand or even just use this solution as last fallback !

1 Like

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