lucian howard
lucian howard

Reputation: 23

ADF expression builder extract portion of string before certain character

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

Upvotes: 2

Views: 8402

Answers (1)

wBob
wBob

Reputation: 14399

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

Upvotes: 3

Related Questions