How to add a value based on another field's value

I'm new to Data Factory. I'm trying to copy the data from a source to Dataverse. So far I have a basic demo that allows me to read data from the source, perform a simple lookup, set the guid and add a static value by using "additional columns" in the source options and copy all of that to my Dataverse table.

However I have a couple of fields in my source data that don't match what I need for Dataverse. E.g. I have a column with 1 or 0 as a value that requires true/false in Dataverse. So I need to something like an "if else" where for every row I can check the value of a field and create a new value based on that that I can later use for lookups and/or copying the data to Dataverse.

I've been looking at the Docs but its a bit unclear to me how I should go about this. How can I best check the value of a field and create a new field with the value I need based on the existing value?


Solution 1:

Data flows in Azure Data Factory is the thing for you.

You can use transformations like Derived column transformation in mapping data flow to generate new columns or modify existing fields. Here you can update columns by identifying their data using patterns, conditions and expressions to set new values.

Example:

Using expression as below to identify a column with 1 or 0 and set required value true/false.

iif(condition, true_expression, false_expression) 

Working example for a column:

iif(toInteger(column_name) == 1,'true', 'false')

enter image description here

verify the transformation using data preview

enter image description here

Refer to learn more: Data transformation expressions in mapping data flow