(LongText) Line Breaks not Carrying over to Report

Good Afternoon Everyone,

I have a report in which the user can set some custom text, greetings, signitures etc,

What seems to be happening is the line breaks that the user has entered in are not being carried over to the report. The output is in 1 long string.

User Email Settings in the App. Column Type (Long Text)

Spreadsheet Cell. Appsheet places into Cell Correctly

Report Output

Anyone have any Idea what could be causing this and what can be done to prevent it?

Thanks,

Solved Solved
0 9 1,535
1 ACCEPTED SOLUTION

I realized that template expressions in the workflowโ€™s โ€œemail bodyโ€ field are parsed differently than when they are in an external template document, so I moved both expressions to an external document, and set it for both email body and attachment template. Only the START expression method worked here, NOT the double-substitute, so try that one instead.

View solution in original post

9 REPLIES 9

What does your template look like?

wow, forgot that part.

<<Any(Settings[Custom Greeting (Based on 9:00am Sending Time)])>>

This is what I am using.

Settings[Custom Greetingโ€ฆ]

Will convert all of the values from this column in the table into a List type. Iโ€™m wondering if the LongText newlines get lost during that conversion. Is there any other way you can reference this value?

Maybe if you were to move into the context of that one row of the table with a single-iteration Start expression, then reference the column directly it would work.
<<START:FILTER( Settings , condition )>><<[custom greeting...]>><<END>>

Alternatively, make a new column in Settings table to substitute all newlines with some special character. Then in the template substitute it back.

SUBSTITUTE( [custom greetingโ€ฆ] , "
" , โ€œ*โ€)

<<SUBSTITUE(Any(Settings[new column]) , โ€œ*โ€ , "
")>>

Itโ€™s also possible that Iโ€™m completely missing the real issue and have hugely overthought this.

Yep. ANY() returns Text, not LongText. Both of your workarounds look good to me.

So Iโ€™ve Tried the above and get a blank result.

Expression in Template
<<START:FILTER( Settings , isnotblank([Custom Greeting (Based on 9:00am Sending Time)] ))>>
<<[Custom Greeting (Based on 9:00am Sending Time)]>>
<>

The Second Option Also Gives a blank output.

Formula in Template
<<SUBSTITUTE(Any(Settings[Substitute]) , โ€œ*โ€ , "
")>>

Formula in Table

I just tried both of my suggestions, and both of them worked. Are you sure the longtext column itself isnโ€™t blank?

Output:
3X_4_f_4f2db135b8c40d3a5fd94c23642a6dda61b60caa.png

Template (workflow run on a different table):
3X_1_a_1a56f38a2ef5611e5d8527ae587bd96410c37788.png

[sub] expression:
3X_1_b_1b7436928159d35def88aa1eb85db7997f242edf.png

record:
3X_8_2_82079e9ae4dbc9c3d6b6e48995819d79b492b0b2.png

So I have It setup just like you, It is replacing the new lines with the asterisk. It is also Taking the asterisk back out in the reportโ€ฆ but it is not creating a new line. For some reason,

<<SUBSTITUTE(Any(Settings[new column]) , โ€œ*โ€ , "
")>>

The formula above Does not cause it to create a new line. Everything is working as you described except when the report is created and sent it does remove the asterisk but for some reason everything just goes back to 1 line.

Is there Something else I can replace the * with to force a new line?

I realized that template expressions in the workflowโ€™s โ€œemail bodyโ€ field are parsed differently than when they are in an external template document, so I moved both expressions to an external document, and set it for both email body and attachment template. Only the START expression method worked here, NOT the double-substitute, so try that one instead.

Im not sure what i did wrong the first time I tried this
Thank you very much. Works perfectly.

@Steve You Should Document this

Top Labels in this Space