ADF expression builder extract portion of string before certain character

Solution 1:

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