1
0
-1

Need some assistance on Data field Configuration in Maestro.

My scenario is that having 5 blocks  with 5 text field and 1 check box data each. I want to have a next and previous button for displaying one block data at a time to the user to select with the check box. Since there is no pagination feature in Maestro we tried to store the block data into a data field component and create a custom java script rule on a button that will paginate through this blocks of data and update the form to display each iteration of data. But we are failing in this process.

Please guide how to do the same.

  1. Umakanta Dalai

    add to Vinodhini comments above:

    Also the result record is not fix to 5. It may be more or less depending on the result of Dynamic lookup.

     

    I don't see the Initial data property for Data Field in maestro

    datafield.PNG

     what is 'data' refers to in the belowscript? is it data field name?

    data.currentIndex = Math.max(parseInt(data.currentIndex) - 1, 0)

    On which rule to put this script? I put it in Action->Click , I got missing radix error for parseInt method

  2. Ben Warner

    You need to select 'Include in Submission Data' for the Initial data property to display.

  3. Ben Warner

    I don't get a radix error - did you try adding a radix?

CommentAdd your comment...

1 answer

  1.  
    2
    1
    0

    You don't need to store all the block data in a data field. All you need is a repeat with some visibility rules to show a single item at a time:

    1. Add a Repeat to your form and set counts to 5


    2. Add a data field outside the repeat to store the current index and set the initial value to zero
    3. Add a block inside the repeat and add a visibility rule:

      data.$i == data.$p.currentIndex;
    4. Add your checkbox and fields to the inner block

    5. Add buttons Previous and Next buttons underneath the repeat to decrement and increment the current Index:

      // Previous button click rule
      data.currentIndex = Math.max(parseInt(data.currentIndex) - 1, 0)
       
      // Next button click rule
      data.currentIndex = Math.min(parseInt(data.currentIndex) + 1, 4);

    The Previous and Next buttons should now cycle through the 5 items in the repeat hiding and showing them.

    Let me know how you go.

    1. vinodhini

      Thank You Ben.

      I had tried with the above steps you provided, but i was not succeed in that. I have attached the document containing the screen shots of the steps we tried. Could you please advice where i went wrong.

      Thanks in Advance.

    2. Ben Warner

      Try renaming your data field to 'Current Index'.

    3. vinodhini

      It's Working Ben. Thank You.

    CommentAdd your comment...