Developer forum

Forum » Integration » Importing many prices from one source line.

Importing many prices from one source line.

Nicolai Iversen
Reply

Hi, I’m trying to import product and prices all in one go.

My CSV file has a layout like this: ProdID;ProdName;Deb1Price;Deb2Price

I have tried using both the Ecom and DynamicWeb providers, but same result.

I try to do the import in one Job, by reusing the my Source table 3 times:

Source               Destination
product.csv     EcomProducts
product.csv     EcomPrices
prodcts.csv      EcomPrices

My first mapping to the products works fine, but the rest of the mappings only imports the first price? 

SourceColoum                   DestinationColoum
prodID                                  PriceProductID
Deb1Prce                             PriceAmount
none                                    PriceCustomerGroupID = Constant with the value of my UserGroup eg. 268
none                                     PriceCurrency = Constant ‘DKK’

Second transformation to EcomPrices, is done in the same way but with a different constant for the GroupID.

Regards  Nicolai


Replies

 
Nicolai Iversen
Reply

Uploading files to reproduce problem:

csv file contains 3 products, each with 2 prices.

After running the job, log tels that only 3 proces, and not 6 prices was imported.

 Tid
 Besked
 
29-01-2014 11:11:00 Starting batch  
29-01-2014 11:11:01 Starting job - test4.  
29-01-2014 11:11:01 Starting import to temporary table for EcomProducts.  
29-01-2014 11:11:01 Added 3 rows to temporary table for EcomProducts.  
29-01-2014 11:11:01 Finished import to temporary table for EcomProducts.  
29-01-2014 11:11:01 Starting import to temporary table for EcomPrices.  
29-01-2014 11:11:01 Added 3 rows to temporary table for EcomPrices.  
29-01-2014 11:11:01 Finished import to temporary table for EcomPrices.  
29-01-2014 11:11:01 Starting update products information.  
29-01-2014 11:11:01 Update products information completed.  
29-01-2014 11:11:02 Finished job - test4.  
29-01-2014 11:11:02 Batch succeeded.  
 
 
Morten Snedker
Reply
This post has been marked as an answer

Hi Nicolai,

 

It is not quite as it should be: You should have one row (!) for each price. You have put up column headers holding the id-values, which is not the proper approach. You should have it look like this (here with column headers in first row that matches the actual column names):

 

PriceID;PriceProductID;PriceAmount
PrisDKK;ProdktNavn1;73.13
PrisDKKVejl;ProdktNavn1;109.69
PrisDKK;ProduktNavn2;50.15;99.95
PrisDKKVejl;ProduktNavn2;50.15;99.95

If the value of the composite key (PriceID+PriceCurrency) is found it is updated. If it is not found it is created.

Let me know if this helps! :-)

 

Regards /Snedker

Votes for this answer: 1
 
Nicolai Iversen
Reply
This post has been marked as an answer

Hi Morten,

OK Thanx, so first, it is not posible to generally import to the same table more than once, like I did ?

The layout is given from the ERP export, but if i can change it, how do I import the prisDKKVejl with a difrent constant for the userGroupID, than the prisDKK ? By using 2 jobs, one for each price, and then a filter so each job will only process half the file ?

Votes for this answer: 1
 
Morten Snedker
Reply

Is it possible to import to the same table more than once in the same job?

Yes and no. No, if using the Ecom Provider where we set the order in the code. Yes, If you use the Dynamicweb Provider, where import will be in the sequence given in the mapping.

 

Changing constant

The constants can be situated in two places: directly on the job or in the import file. If putting it in the source file is not an option, yes then two jobs and filtering is the way to go.

 

Regards /Snedker

 

 
Nicolai Iversen
Reply

Hi Morten.

Ok.. I will try out the Dynamicweb Provicer, and see if i can make it import to both the Products and 2xPriceMatrix in the same job.

The sample csv file is gratly simplyfied, the real one will have data for me to both create the products and 4 prices in the pricematrix.

I'm normaly use to solving thise problems using the SSIS on a SQL server, so I'm trying to grasp the difrence in this tool :-)

Regards
NIversen

 
Morten Snedker
Reply

An important question here: will the import CSV contain ALL products? If it does, you're home-free...

 

The Dynamicweb Provider will be a bad choice in your case.

 

You must be logged in to post in the forum