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.
Anyone have any Idea what could be causing this and what can be done to prevent it?
Thanks,
Solved! Go to 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.
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:
Template (workflow run on a different table):
[sub] expression:
record:
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
User | Count |
---|---|
17 | |
12 | |
5 | |
5 | |
5 |