Skip to main content

Handlebars helper reference

Follow

Comments

16 comments

  • Tony Zuko

    Thank you for the reference! Where can I find a list of options for the "options" parameter for regexMatch?

    Comment actions Permalink
  • Tom Santiago

    Hi Tony, I've updated the article to link to this resource for regex options: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions. I hope that helps. Thanks for the feedback.

    Comment actions Permalink
  • Jeff Dollard

    Is there an example for the #switch syntax?  It's the only block logical operator that doesn't have any hint as to the syntax.

     

    Comment actions Permalink
  • Courtney Jordan

    Hi Jeff Dollard,

    Thanks for providing this feedback! We're looking into this for you.

    Comment actions Permalink
  • David Gollom

    The substring description for the end index doesn't match the behavior.  The end index acts like javascript and it's non-inclusive.  That should be noted above.  This was baffling me for a bit.  How did this {{substring "itemizationCode" 0 4}} return "item" ?? 

     

    Comment actions Permalink
  • Courtney Jordan

    Hi David Gollom,

    Thanks for letting us know - I updated the article with this note. Is there anything else we should add based on your findings? Thank you so much for your help!

    Comment actions Permalink
  • Courtney Jordan

    Hi Jeff Dollard,

    We haven't found any information on the switch handlebars. Have you had any luck?

    Comment actions Permalink
  • Jeff Dollard

    Hi Courtney - no luck with the switch syntax, I sort of gave up on guessing at it ¯\_(ツ)_/¯

     

    I found another way to structure my logic, so it didn't keep me from moving forward.

    Comment actions Permalink
  • Courtney Jordan

    Awesome, glad to hear it, Jeff Dollard! Any cool tips you can share that we could add to the docs?

    Comment actions Permalink
  • APC DSR

    Shouldn't the output be "123 Anywhere789 Somewhere"? Both have values.

    Comment actions Permalink
  • Tom Santiago

    Hi APC DSR, 

    This image describes why the expression evaluates to false:

    We've revised the example for clarity.

    Comment actions Permalink
  • Courtney Jordan

    Thank you so much for letting us know how we could improve the article, APC DSR! Please let us know if there are other things we can add! We've also added more examples to the #and section. Hope they're helpful!

    Comment actions Permalink
  • viliandy leonardo

    Jeff Dollard 

    I want to let you know that the "Switch" syntax is not supported. We are updating this KB. Thanks for bringing it to our attention!

    Comment actions Permalink
  • Jeff Dollard

    Do sum and add helpers only work with integers or can they be used with decimals/float values?

    Comment actions Permalink
  • Courtney Jordan

    Hi Jeff Dollard,

    That's a great question and we'll update our article accordingly. I just tested this and decimals and floats seem to work fine for both add and sum. Let us know if you run into any issues!

    Comment actions Permalink
  • Steve Klett

    I'm trying, but I don't understand the purpose of getValue,- why not just reference the field directly?

    {{field}}

    Apparently there is a second parameter with "default value" used in the example, but I don't how it's used.

    Why does the following example return null? I would expect either an empty string or... "default Value"

    {{getValue "legends.total" "defaultValue"}}

    Anyway, I was reading this page (again) and stopped on getValue to learn about it and after failing to do so I thought I'd leave this comment.

     

     

    Comment actions Permalink

Please sign in to leave a comment.