0

I am creating a new Opportunity in Sales Cloud using AMPscript and I need to insert line breaks in the Description field (Long Text Area, 32000).

This solution did not work: Pass line break to Long Text Field from Journey Builder

Also tried the following:

concat("grade: ",RequestParameter("Grade"),"\n","comment: ",RequestParameter("Comment"))

concat("grade: ",RequestParameter("Grade"),"\\n","comment: ",RequestParameter("Comment"))

concat("grade: ",RequestParameter("Grade"),"<br/>","comment: ",RequestParameter("Comment"))

concat("grade: ",RequestParameter("Grade"),"<br/>","comment: ",RequestParameter("Comment"))

All of those are displaying as text since I am passing them as a string, what am I missing here?

1
  • %%=concat("grade: ",RequestParameter("Grade"),char(10,1),"comment: ",RequestParameter("Comment"))=%% -- Hi @zuzannamj Does this help? – Naveen VM May 22 '20 at 14:15
3

I didn't test it, but according this post it's \r\n

EDIT:
Correct way seems to be %%=UpdateSingleSalesforceObject('Opportunity','ID','Description',Concat('new', CHAR(10), CHAR(13), 'line'))=%%

3
  • Thanks - already tried it but couldn't get it to work – zuzannamj May 22 '20 at 13:13
  • @zuzannamj found a solution, please see the edit on response – Mateusz Bartkowiak May 22 '20 at 14:02
  • Yay, thank you Mateusz :-) Actually CHAR(10) was enough`. – zuzannamj May 22 '20 at 16:44
0

Moving from comment to answer:

I have tested in my instance. The answer by @Mateusz also works. And this also works.

%%[
Set @character = char(10,2)
Set @newline = concat("New",@character,"Line")
UpdateSingleSalesforceObject('Opportunity','0061t000002axd0AAA','Description',@newline)
]%%

Let me know if this works for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.