Developer forum

Forum » Integration » Inverting a boolean value during import

Inverting a boolean value during import

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hi,

What would be the best (and easiest ;-)) way to invert a value during import.

In the source data there is a boolen Field X, if field X = true then in DynamicWeb the field "Never out of stock" should be false.

if field X = false then in DynamicWeb the field "Never out of stock" should be true.

Thanks,

Justin

 


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Hi Justin,

I think it depends on the source provider.
If you are using the xml provider then you can create and select an xslt file for transforming the source xml data.
Otherwise, I think you would have to implement a custom extension in C# - TableScript or Adapter.

TableScript (simple)
Create a class which inherits from Dynamicweb.DataIntegration.Integration.TableScript
Implement the ProcessInputRow method which allows you to manipulate the data values for each row of input data.

Then configure the import to use your custom table script.

Adapter (advanced and configurable)
Create a class which inherits from Dynamicweb.DataIntegration.Integration.Adapters.AdapterBase
Override the GetNext method which allows you to manipulate the data values for each row of input data.
Then configure the import to use your custom adapter.

Best regards,
Morten

Votes for this answer: 1

 

You must be logged in to post in the forum