Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement if else and else if in ADF dynamic expression

How can I achieve below conditions in ADF dynamic expression:

if variable=a then A
if variable=b then B
else C

I'm able to achieve only true or false condition in IF but here I want to verify multiple conditions. No switch case function available in adf dynamic expression.

like image 863
Krishna Murthy Avatar asked Dec 01 '25 03:12

Krishna Murthy


1 Answers

The if function in Azure Data Factory's (ADF) expression language only supports one true or false condition and no switch function but you just have to nest them. Use the equals function for value comparison. Something like this:

@if(equals(variables('varInput'), 'a'), 'Ax', if(equals(variables('varInput'), 'b'), 'Bx', 'C'))
like image 121
wBob Avatar answered Dec 04 '25 16:12

wBob