ADF expression builder extract portion of string before certain character

Viewed 1292

This is what the expression looks like

Expression builder /output

I need to get the substring teBatches_raw to only return everything before the _ character.

Expected output

teBatches

1 Answers

Azure Data Factory (ADF) and Synapse Pipelines have an expression language with a number of functions that can do this type of thing. You can use split for example to split your string by underscore (_) into an array and then grab the first item from the array, eg something like:

@{split(pipeline().Pipeline, '_')[0]}

Or with a variable, not using string interpolation:

@split(variables('varInput'), '_')[0]

My results for the variable line:

results

Related