Email If statement error when using "LCase" formula
AnsweredHi,
I keep getting errors when my IF statement contains formulas containing "LCase" is this a known problem? If I remove the "LCase" there is no error, but my issue is, that I do not know whether or not the subject in this particular case will contain a text saying "Faktura, FAKTURA, FAktura, FAK,tura, fAKTURA, faktura or or or", therefore I made a formula saying If [?LCase([*CURRENT_EMAIL_SUBJECT])] contains "faktura" then.... but it will error every time. Then I need to have a bunch of different If conditions to make sure I have all scenarios covered, but this just seems odd, when we actually have the option to say LCase… I am using version 14.6.1 FYKI.
Thank you in advance
Ghita
-
Hi Ghita!
We have not heard about this issue before. I will do some digging today and investigate. In the meantime, do you also experience issues with this if you create a variable setting its value to the email subject token and then use the variable instead of the token in your formula?
-
hmm... did some more testing.
1. when the script is "running" it will return with an error on the if-statement. If I manually double-click the if-statement, it will work.
2. I tried creating a variable with the [?LCase([*CURRENT_EMAIL_SUBJECT])], and the variable will be created, with a blank value!
3. Created a variable with value [*CURRENT_EMAIL_SUBJECT] - created the variable and the value was correct (FW: Message from "RNP583879273CB3" / NGB/OSL/00225)
4. After creating a variable with the current email subject, I did a new IF-statement with LCase from the variable, and the same error came like before. If I manually run the if-statement all is good, but when pressing play it will result in an error! :o(
I guess there must be something in the email subject that it will tricker the error on. maybe the apostrophes!?
Thanks
Ghita
-
so.. I fixed it by using the formula like this, but I guess this still need to be investigated, since something is triggering an error where it shouldn't.
[?LCase([?Remove([*CURRENT_EMAIL_SUBJECT],false,true,true,true)])] - I have other scripts though where I cannot remove all other things than the text itself, so they will be a bit more tricky I guess.
Thanks
Ghita
-
Hi Ghita,
Yeah, I was about to write the same. I would approach it similar to what I do in the video. I cannot recreate the issue, but the best and easiest way of figuring out exactly what is going on is by splitting everything up into separate actions.
VIDEO: https://www.screencast.com/t/t9XrkBzjnW
I could even split it up into more actions, one "Formula" actions per formula instead of embedding them. I know that makes your script longer, but then you can see exactly what is going on and make sure that your variable has the expected value heading into the if-statement.
Please sign in to leave a comment.
Comments
5 comments