Reputation: 93
I have a configuration table with tables names to copy data. Sometimes I want all the columns, so I don't have to specify the mapping. But sometimes, I only want some columns. Is it possible to have a mapping json null and CopyDAta activity will take all the columns?
I tried to have the value nullable like that:
But it throw an error when the value is null in the configurable table.
Is it possible?
Upvotes: 1
Views: 1640
Reputation: 1607
You can use a default mapping if null in the table. From one of my Copy data activities with no mapping, it looks like
{
"type": "TabularTranslator",
"typeConversion": true,
"typeConversionSettings": {
"allowDataTruncation": true,
"treatBooleanAsNumber": false
}
}
In the Mapping it would look something like this (not verified), replace the value in <> with above or better yet store in a variable and use the variable there.
@json(if(equals(item()?TrustedMapping, null), <default>, item()?.TrustedMapping))
Upvotes: 1