SJEaton Posted April 20, 2018 Posted April 20, 2018 Hi I have an email template called WFServicesOvertimeApproval that uses ESP conditions so that information is only displayed if something is entered in the custom fields on the PC. When it generates it always also brings back 'undefined' at the end (see example attached) and I can't determine why this is happening. Can anyone take a look as advise? Thanks Sam
Dan Munns Posted April 20, 2018 Posted April 20, 2018 In the email template what is the variable 'undefined' supposed to be? I would check the SR in db direct and make sure that all custom field mappings are correct (If it is a custom field (more than once I have selected the wrong custom field and only realised when something doesn't work!)) Unanswered PC questions don't show as undefined anymore (tested by adding 26 variables into a single line in a custom field to extract the one answer a user could have provided) so must be a blank field somewhere else.
SJEaton Posted April 20, 2018 Author Posted April 20, 2018 I don't know what undefined is supposed to be, as far as I am aware, nothing! I've tested all the variables and they all work fine if something is entered in each of them so that's why I'm miffed about what the undefined is. Sam
Victor Posted April 20, 2018 Posted April 20, 2018 @SJEaton the template used to send the email should show what variable is used where "undefined" appears...
SJEaton Posted April 20, 2018 Author Posted April 20, 2018 yes but all the variables in the template work fine, there are none that don't pull through
Victor Posted April 20, 2018 Posted April 20, 2018 6 minutes ago, SJEaton said: yes but all the variables in the template work fine, there are none that don't pull through Not that I don't believe you but the "undefined" at the bottom of the email suggests there might be a variable there. Just to clarify this, may I as if you can post a screenshot of the current template configuration, the template used to send that email?
SJEaton Posted April 20, 2018 Author Posted April 20, 2018 This is the template and what it generates if all custom fields are entered in the PC.
Victor Posted April 20, 2018 Posted April 20, 2018 @SJEaton it looks like in your first example (SR00032731), the Custom N variable has an "undefined" value... any idea why it could have such value in that scenario?
SJEaton Posted April 20, 2018 Author Posted April 20, 2018 No idea. Out of curiosity how did you identify it was Custom N? I'm just going to remove it and start again I think. I also have another issue on these emails to do with the date/time displaying 1 hour before what is entered in the PC but this is being address under another topic Sam
Victor Posted April 20, 2018 Posted April 20, 2018 1 minute ago, SJEaton said: Out of curiosity how did you identify it was Custom N? I looked at the template ... After "Claim Details" line you have a bunch of variables on each line. Then I matched the lines in your email examples with the lines in the template: - the first line in the template (after "Claim Details" line) is {{.H_custom_l}} and matches the first line in the email 23-04-2018 23:00; - the second line in the template (after {{.H_custom_l}}) is {{.H_custom_d}} and matches the second line in the email 1 hours; - etc. - until I reached the {{.H_custom_n}} line in the template which matched the "undefined" line in the email. I highlighted this in the screenshot as well...
SJEaton Posted April 20, 2018 Author Posted April 20, 2018 OK Thanks. Well I've re-done the template and it seems ok now. Now I just need to sort out the date/time issue and all is good lol Sam
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now