lgarrison Posted December 12, 2016 Share Posted December 12, 2016 trying to add bullets before Fax and Cell phone when they're available. It's showing for the Cell but not fax. Any thoughts? var fax = Rule("Change fax phone format Rule"); var cell = Rule("Change Cell phone format Rule"); var numbers = ["Fax: " + fax,"Cell: " + cell]; return numbers.filter(function(m){return m.match(/.*\s(?=.)/);}).join(" • "); Quote Link to comment Share on other sites More sharing options...
step Posted December 12, 2016 Share Posted December 12, 2016 It's not working because you're using the join method. Try this: var fax = Rule("Change fax phone format Rule"); var cell = Rule("Change Cell phone format Rule"); var result = ""; if (fax) result += '• Fax: ' + fax + ' '; if (cell) result += '• Cell: ' + cell; return Trim(result); Or: var fax = Rule("Change fax phone format Rule"); var cell = Rule("Change Cell phone format Rule"); return ["Fax: " + fax,"Cell: " + cell].map(function(s){ return /^.*\s\w+$/.test(s) ? '• ' + s : ''; }).filter(String).join(' '); Quote Link to comment Share on other sites More sharing options...
lgarrison Posted December 12, 2016 Author Share Posted December 12, 2016 Thank you! That fixed it. 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.