Hallo,
i have an issue where the email subject in a flow must not be >100 characters.
so when an item is created i want to set the t\Title field in a variable .
then i use an expression which however returns a random string and not the first 99 characters concatenated with '...'
if(greater(length(variables('var_Title')),100),concat(substring(variables('var_Title'),99),'...'),variables('var_Title'))
The flow does not fail as before but i want the correct subject
Any ideas ?
Solved! Go to Solution.
The substring expression accepts three parameters:
Your expression:
if
(
greater(length(variables('var_Title')),100),
concat(substring(variables('var_Title'),99),'...'),
variables('var_Title')
)
You are specifying only two parameters which means the substring is starting at position 99 and continuing until the end of the string, and then appending "...". You perhaps want it like this:
if
(
greater(length(variables('var_Title')),100),
concat(substring(variables('var_Title'),0,99),'...'),
variables('var_Title')
)
But you also said the subject must not be more than 99 characters, 99+3 is 102, so perhaps you only want to capture the first 66 characters? Anyway, this should fix your issue.
@marial16 , the expression looks correct to get the first 99 characters and append '...' to it, what result does do you get out of it?
Instead of getting for example:
TextTexttexttextedfhdivbdsjhvdddvbd.....
i get the final dddvbd..... characters.
i Apologize for the random data . i hope its clear
The substring expression accepts three parameters:
Your expression:
if
(
greater(length(variables('var_Title')),100),
concat(substring(variables('var_Title'),99),'...'),
variables('var_Title')
)
You are specifying only two parameters which means the substring is starting at position 99 and continuing until the end of the string, and then appending "...". You perhaps want it like this:
if
(
greater(length(variables('var_Title')),100),
concat(substring(variables('var_Title'),0,99),'...'),
variables('var_Title')
)
But you also said the subject must not be more than 99 characters, 99+3 is 102, so perhaps you only want to capture the first 66 characters? Anyway, this should fix your issue.
Looks like it solved the issue.
Thank you all
User | Count |
---|---|
90 | |
41 | |
22 | |
20 | |
16 |
User | Count |
---|---|
134 | |
54 | |
47 | |
36 | |
25 |