1
0
-1

Hello,

I would like to get option label from dropdown placed in repeat block. How can I achive that?

    CommentAdd your comment...

    3 answers

    1.  
      2
      1
      0

      Hi Kamil,

      I never got Form.getSelectionLabel method working in a repeat. It works for dropdowns not in repeats though. The alternative solution that worked for me is as suggested in How do I retrieve the label instead of the value?:

      label = Form.getItemFromPath('Form.data.repeat[index].field');
      label = Util.find(label.properties.options, "value", Form.data.repeat[index].field);

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

        If you want the label (not the value) of the dropdown you can use the Form.getSelectionLabel method.

        As seen in this question/answer How do I retrieve the label instead of the value?

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

          Hi,

          If you want to insert the option label into a Text Display comonent, do this:

          1. Select the text display component
          2. Click the Edit icon to edit its text
          3. Move the cursor to where you want to insert the Dropdown's selected label
          4. Click 'Insert Field Value'
          5. Locate your Dropdown component in the tree and double-click it
          6. Click Save

           

            CommentAdd your comment...