question

ChilukurthiHarikrishna-4158 avatar image
0 Votes"
ChilukurthiHarikrishna-4158 asked ShaikMaheer-MSFT rolled back

How to break line in web activity body

Hi experts,



i'm trying to break line in web activity body. Below is how i'm trying



"ErrorMessage": "

TableName: @{activity('Lookup1').output.firstrow.tablename}\\nTableCount: @{activity('Lookup1').output.firstrow.tablecount}\\nAverageCount: @{activity('Lookup1').output.firstrow.avgcount}\\nPercentage: @{activity('Lookup1').output.firstrow.percentage}

",



i want my output like



TableName : <tableaname>

TableCount : <Count>

AverageCount : <AvgCount>

Percentage : <Percentage>



but right now it is all coming in single line without any break , like below



TableName : <tableaname>TableCount : <Count>AverageCount : <AvgCount>Percentage : <Percentage>



Can someone please help me?

azure-data-factory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ShaikMaheer-MSFT avatar image
0 Votes"
ShaikMaheer-MSFT answered ShaikMaheer-MSFT rolled back

Hi @ChilukurthiHarikrishna-4158 ,


I found a work around for your problem,

Use html tags to get line breaks.

In below example, I am using HTML tag <br/> to get line breaks. Please follow the same to solve your issue.

Web Activity:
106474-webactivitytogetlinebreaks.png

Sample Email
106655-email.png

Hope this helps you.


  • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

  • Want a reminder to come back and check responses? Here is how to subscribe to a email-notifications.



email.png (158.6 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for finding this out for me. it is working. Appreciated

0 Votes 0 ·
ShaikMaheer-MSFT avatar image ShaikMaheer-MSFT ChilukurthiHarikrishna-4158 ·

Hi @ChilukurthiHarikrishna-4158 ,

Glad to know that its Working. Happy to help. Thank you.

0 Votes 0 ·
ShaikMaheer-MSFT avatar image
0 Votes"
ShaikMaheer-MSFT answered ChilukurthiHarikrishna-4158 commented

Hello @ChilukurthiHarikrishna-4158 ,

Thank you for posting your query in Microsoft Q&A platform.

Use enter button hits to split lines instead of manually adding \n.

When you use \n or \\n inside the string directly, then ADF will try consider that \ symbol also part of string and it will try to escape it by adding another \ symbol to it.

Between, Could you please help us to understand where you want to load these lines break data ?

Hope this helps you. Thank you.



  • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

  • Want a reminder to come back and check responses? Here is how to subscribe to a email-notifications


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi ShaikMaheer,

Thank you For your response. I'm trying to send an email notification to users with data as below.

TableName : <tableaname>
TableCount : <Count>
AverageCount : <AvgCount>
Percentage : <Percentage>

so i'm trying to create this message using web activity. when i created it i'm able to get the output but it is giving information in single line like how i expalined in my previous post. I dont know enter buttion hits reslove this issue as got same one liner result without using \n in my web activity.

0 Votes 0 ·
ShaikMaheer-MSFT avatar image ShaikMaheer-MSFT ChilukurthiHarikrishna-4158 ·

Hi @ChilukurthiHarikrishna-4158 ,

Thank you for sharing details.
Could you please try adding enter button hits directly to get line breaks and see.

Also, Could you please help us to understand, that this web activity API call is going to hit any logic app/Function and that process in turn sends email notification?

If yes, you can handle these line breaks in that Logic App/Function too to compose your email body with line breaks in it.

Hope this helps. Thank you

0 Votes 0 ·

Hi,

i understand that enter button hits nothing but press enter after each line. just like below

"ErrorMessage": "

TableName: @{activity('Lookup1').output.firstrow.tablename}
TableCount: @{activity('Lookup1').output.firstrow.tablecount}
AverageCount: @{activity('Lookup1').output.firstrow.avgcount}
Percentage: @{activity('Lookup1').output.firstrow.percentage}
",

if so, i tried it but no luck.

other option you suggested may be only option but i need devops team to check that out as i cannot access the code directly.

0 Votes 0 ·