iif condition in Expression builder in ADF Alter row

Nemade, Pradnya 0 Reputation points
2025-03-12T10:28:32.18+00:00

Hi Team,

In my source file, i have country column there i have list of countries. In my source data country name Spain is now changed to "Espana". for this i want to write update condition in AlterRow condition.

I tried following condition:

iif(country == 'Espana', 'Spain', country), so i am getting error as Data flow expression should return boolean.

Here, i want to update data as wherever in country column "Espana" is present it should update as "Spain".

Could you please help me to get the expected result also where exactly this condition should be written, i hope AlterRow is the correct place. please suggest on the same.

Thanks,

Pradnya

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,339 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 29,711 Reputation points
    2025-03-12T13:14:02.6733333+00:00

    Hi Pradnya,

    You should use the Derived Column transformation instead of the Alter Row transformation.

    In your data flow, add a Derived Column transformation after your source transformation.

    In the Derived Column transformation, you can define an expression to update the country column.

    
    iif(country == 'Espana', 'Spain', country)
    
    

    In the Derived Column settings, you can create a new column or update the existing country column with this expression.

    If you want to update the existing country column, select it from the dropdown and use the expression above.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.