Forum Discussion

pgatu's avatar
pgatu
New Contributor
2 years ago

CSV to EAV Schema

Hello Snaplogic Community,

I'm currently working on a project where I need to import data from a CSV file into an EAV (Entity-Attribute-Value) schema in a Postgres database. I'm looking for advice on best practices for implementing this process, especially considering the complexity of handling around 100 EAV attributes.

Here's an example of the CSV file format:
supplier_id;supplier_address;supplier_phone;
123;Berlin;123123132123
321;Munich;9549595945

And this is the database structure I'm working with:

infotypes table:

  • id: 1 = Supplier Address
  • id: 2 = Supplier Phone Number

supplierinfos table:

  • id;infotype_id;supplier_id;value
  • 1;1;321;Berlin
  • 2;2;321;123123132123

I would appreciate any insights or recommendations on how to efficiently map the CSV data to the EAV schema. What are the best practices for handling such a transformation in Snaplogic? Are there any specific Snaplogic features or patterns that would be particularly helpful for this use case?

Thank you in advance for your assistance!

  • psadasivam's avatar
    psadasivam
    New Contributor III

    @pranil2k2, Just make sure you are passing array of JSON object to email Snap as shown below and Table-data path is set to $

    • kindminis's avatar
      kindminis
      New Contributor

      Hi, how would this work if I wanted to output multiple tables in one email body? Thanks.