How to place a new line (line feed) in dynamic expression in Azure Data Factory

4.3k Views Asked by At

I am trying to add a line break using dynamic expression in Azure Data Factory. Tried using a variable and setting its value as empty line and '%0A' or '%0D' but doesn't seem to work.

Sounds silly yet not able to find a way out! Any help is much appreciated, thanks in advance.

3

There are 3 best solutions below

1
Utkarsh Pal On

Use \r,\n or \r\n or \n to change the line using dynamic expression.

Example:

Dynamic content editor converts above content to expression "{ \n \"type\": \"@{if(equals(1, 2), 'Blob', 'Table' )}\",\n \"name\": \"@{toUpper('myData')}\"\n}". The result of this expression is a JSON format string showed below.

{
  "type": "Table",
  "name": "MYDATA"
}

Learn more about Expressions and Functions in ADF here.

0
Mukesh Kumar Mehta On

use @concat('your value','
\n
\n','Your value')

it works for me

0
Ramesh Velayudhan On

I was looking for a similar solution as I wanted to add new line in a message that was used in Send Mail activity of Logic. I tried all approaches above but nothing worked, but this post https://stackoverflow.com/a/76655453/21954621 helped me. for. e.g

"message" : "@{concat('First Line','</br>','Second Line'
    ,'</br>','Third Line')}"