Hi there,
How do I use @Code to combine (or use) columns that are not in the destination mapping? As an example, let's say I wanted to set ProductName to ProductNumber_ProductName using @Code like this:
@Code(data["ProductNumber"]?.ToString() + "_" + data["ProductName"]?.ToString())
For this to work, I assume the mapping needs to explicitly define the ProductNumber and ProductName columns. But when I try, I run into a few issues:
1. When I use a single column (ProductName) and set up the column as a @Code type, the UI automatically brings back and selects the Source column which I think shouldn't be there:
Then when I run the job, the @Code doesn't seem to be executed and the Name stays what it is in the source file.
2. If I use multiple columns, it fails at run time:
with the mapping defined as follows:
I get the same result whether ProductName / ProductNumber are active or not.
3. If I remove the columns from the mapping I get the same error.
So in summary: how do I use @Code to access multiple columns in the source provider and combine them into a single one?
Imar