bdgreene88 Posted December 15, 2015 Share Posted December 15, 2015 Thanks in advance for your help! I need to create a tabbed list within the body of a letter. All the lists are all variable. It would look like the following: <improve_1>TAB<improve_2> <improve_3>TAB<improve_4> <improve_5>TAB<improve_6> <improve_7>TAB<improve_8> <improve_9>TAB<improve_10> <improve_11>TAB<improve_12> <improve_13>TAB<improve_14> <improve_15>TAB<improve_16> <improve_18>TAB<improve_18> Not all of the variables are used. Some just have just 1, others have all 18. The body of the letter will need to flow with the tabbed list. My problem is when I use "suppress if containing empty variables", it removes the entire line if just one of the variables are empty. Any advice you can give would be GREATLY appreciated. Thank you! Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted December 15, 2015 Share Posted December 15, 2015 bdgreene I'm just a hack when it comes to javascript but you can make rules for each line. You don't have to select anything and suppress it. //Rule for improve_1 and improve_2 line if ((Field("improve_1") != "") && (Field("improve_2") != "")) return Field("improve_1") + '<t>' + Field("improve_2"); else if ((Field("improve_1") != "") || (Field("improve_2") != "")) return Field("improve_1") + Field("improve_2"); else return ""; Quote Link to comment Share on other sites More sharing options...
step Posted December 15, 2015 Share Posted December 15, 2015 You can make a rule to return them all with the appropriate formatting: fields = []; i = 0; while (i < 18) { r=[]; while (r.length<2 && i<18) if (a = Field('improve_' + ++i)) r.push(a); fields.push(r.join('<t>\t')); } return fields.join('<br>\n') Make sure that that "Treat returned strings as tagged text" is checked. Quote Link to comment Share on other sites More sharing options...
bdgreene88 Posted December 15, 2015 Author Share Posted December 15, 2015 THANK YOU! That worked perfectly! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.