The incredible disappearing text

Mo’ reports, mo’ problems. I have a report that uses a few ifs statements. Most of the time, for some reason, the last bit doesn’t appear in the resulting report at all, not sure why. Here’s the template for the whole section:

Assessment Status:

Last Assessment: <<ifs([Current Level]=1,[Level 1 Assessment].[date],[Current Level]=2,[Level 2 Assessment].[date],[Current Level]=3,[Level 3 Assessment].[date])>>

Next Assessment Due: <<ifs

(and([Current Level]=1,isblank([Last Assessment Date])),[Program Start Date]+30,

and([Current Level]=2,isblank([Last Assessment Date])),[L1 Assessment Linked].[date]+62,

and([Current Level]=3,isblank([Last Assessment Date])),[L2 Assessment Linked].[date]+62,

True,

[Last Assessment Date]+62

)>>

Date Scheduled: <<[Actual Scheduled Date]>> <<if: OR([Actual Scheduled Date]<[Last Assessment Date],[Actual Scheduled Date]<today())>>

Please schedule a new assessment date in the TTS system or contact your area’s Trainer.<<endif>>

The last section that starts with “Date Scheduled” is sometimes missing from the report entirely, and it should at least say “Date Scheduled: (whatever the date is)”. Do I need an endifs in there somewhere? There is an endif at the very end, it just won’t show up on my post. I haven’t found any documentation on using ifs in a template. Other than that, it works a dream. Thanks!

Solved Solved
0 6 169
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

My understanding (which may be incomplete) is that template tags may not be split across lines; i.e., the tag’s << and >> must be on the same line. That makes long expressions ugly and difficult to read, but I believe it is a requirement.

Assessment Status:

Last Assessment: <<ifs([Current Level]=1,[Level 1 Assessment].[date],[Current Level]=2,[Level 2 Assessment].[date],[Current Level]=3,[Level 3 Assessment].[date])>>

Next Assessment Due: <<ifs(and([Current Level]=1,isblank([Last Assessment Date])),[Program Start Date]+30, and([Current Level]=2,isblank([Last Assessment Date])),[L1 Assessment Linked].[date]+62, and([Current Level]=3,isblank([Last Assessment Date])),[L2 Assessment Linked].[date]+62, True, [Last Assessment Date]+62)>>

Date Scheduled: <<[Actual Scheduled Date]>> <<if: OR([Actual Scheduled Date]<[Last Assessment Date],[Actual Scheduled Date]<today())>>

Please schedule a new assessment date in the TTS system or contact your area’s Trainer.<<endif>>

View solution in original post

6 REPLIES 6

It is likely syntax that is causing a problem - e.g. a misplaced “)” or some such thing.

First, I would make sure that ALL of your pasted text is appearing in the post. You can do this by using the “block” feature (for lack of knowing what its really called). This is just 3 back quotes before the text and 3 backquotes after the text. Back quote is the one under the “~” (tilda) symbol in the upper left hand side of the keyboard

This is blocked text

            It keeps proper formatting and characters such as <<a variable>>

See the image to see what it looks like before posting!
     

This is the image below
3X_c_7_c760b74da5e2394fc936b61a7667e0e031814eb6.png

I have taken a deep look and assuming everything in the post is as in the template except for the <<EndIf>> not appearing at the end, I see nothing wrong with the syntax.

I don’t know for sure if IFS() is supported but expression are and I would think the parser would parse the IFS() function like any other function. You would not need an <<End If>> for the IFS().

Based on this comment I take that sometimes you DO get the last message? If so then I would take a close look at the differences between those cases that do work versus those that don’t. Maybe some data value is tripping it up?

Also to rule out any kind of parser problem, I would insert a space before and after the “<” (less than) or “>” (greater than) symbols. My thought is maybe the parser is incorrectly reading them. A stretch I know but stranger things have happened.

Steve
Platinum 4
Platinum 4

My understanding (which may be incomplete) is that template tags may not be split across lines; i.e., the tag’s << and >> must be on the same line. That makes long expressions ugly and difficult to read, but I believe it is a requirement.

Assessment Status:

Last Assessment: <<ifs([Current Level]=1,[Level 1 Assessment].[date],[Current Level]=2,[Level 2 Assessment].[date],[Current Level]=3,[Level 3 Assessment].[date])>>

Next Assessment Due: <<ifs(and([Current Level]=1,isblank([Last Assessment Date])),[Program Start Date]+30, and([Current Level]=2,isblank([Last Assessment Date])),[L1 Assessment Linked].[date]+62, and([Current Level]=3,isblank([Last Assessment Date])),[L2 Assessment Linked].[date]+62, True, [Last Assessment Date]+62)>>

Date Scheduled: <<[Actual Scheduled Date]>> <<if: OR([Actual Scheduled Date]<[Last Assessment Date],[Actual Scheduled Date]<today())>>

Please schedule a new assessment date in the TTS system or contact your area’s Trainer.<<endif>>

Very good to know!

And just to be clear, by “same line” it is meant a line with no line breaks in the form of return, new lines, etc. Line wrapping, which many editors will do, IS okay? Is that right?

Correct.

If the “line-wrapping” is merely done on-screen rather than scrolling, yes, that’s fine. If you can toggle line-wrap off and you then need to scroll to the side to see rest of the line, you’re golden.

Steve’s advice about eliminating unnecessary carriage returns from the code was the solution.

Top Labels in this Space