1
0
-1

I am currently using a button group in Maestro:

  • Max Rewards (label), 1 (value)
  • Low Interest (label), 2 (value)

How can I get the label returned in a data field (to be used in emails) instead of the value?

 

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Check out Form.getSelectionLabel() in the API Methods reference panel.

      1. Stephanie Siao

        Form.getSelectionLabel('data.buttonGroup1', data). What should go in data?

      2. Ben Warner

        Just leave it as data.

      3. Stephanie Siao

        Confirm that Form.getSelectionLabel() works. Thanks!

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Please note there is a shortcut for this function if you right-click the button group item in the hierarchy of the script editor and select Get selected option label:

      1. Stephanie Siao

        Hi, I used the following calculation rule on one of my text field to display the label of a button group: "return Form.getSelectionLabel('data.buttonGroup1', data) " The field is however staying blank even though I have a selection on the button group. Any thoughts on this? Thank you.

      2. David Moore

        The issue has been found and fixed. This will be in the next release. A work around would be to use this code. var item = Form.getItemFromPath('data.dropdown'); var selectionObj = Util.find(item.properties.options, "value", data.dropdown); return (selectionObj && selectionObj.label) || "";

      3. Ben Warner

        Confirmed that this temporary work around also works for button groups as per the original question. var item = Form.getItemFromPath('data.buttonGroup1'); var selectionObj = Util.find(item.properties.options, "value", data.buttonGroup1); return (selectionObj && selectionObj.label) || "";

      CommentAdd your comment...