Developer forum

Forum » Integration » Importing new redirects/rows to UrlPath

Importing new redirects/rows to UrlPath

Filip Lundby
Reply

Using the Data Integration module I'm exporting redirects from the table UrlPath to a CSV - I can modify existing rows and import those back into DW. This works just fine.

But how would I add new rows? When I'm modifying rows, I can leave UrlPathID as it is - But what ID should I assign for new rows? If I leaving UrlPathID empty in the CSV and then run the import task - DW will return an error.


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Filip

The UrlPathID ​is an DB Identity - if you include the column in your data, DW will take your data and import it to the column - that means you need to make sure each row has a valid and unique value.

You can also NOT include that column - for all rows. Then the DB will insert its own identity. But then you cannot update using the ID as key but need to use one of the other columns which should be fine.

 
Filip Lundby
Reply

Thanks Nicolai. Think I'll try create two import tasks - one for updating and one for inserting new rows.

 
Morten Snedker
Reply
This post has been marked as an answer

Hi Filip,

Additionally: 

The best way of getting to know what should be in the different columns of the table, is to simply export it first. Create some redirects from Management Center if you do not already have some - just to make sure the table UrlPath has content.

Use Dynamicweb Provider for source and CSV for destination, and choose table UrlPath for table to output. This will produce at CSV file, and the content will give you an idea of how the content for each column is expected to look like.

As Nicolai mentioned, you may consider whether or not you include the ID of the table in your mapping.

 

Best regards

Morten Snedker

Votes for this answer: 1
 
Filip Lundby
Reply

Thanks Morten. I've solved it by creating two import task one with UrlPathID and one without.

 

You must be logged in to post in the forum