Skip to main content
amitk9244
November 30, 2022
Question

Storing Looping data in ruleinput

  • November 30, 2022
  • 1 reply
  • 0 views

I have created dynamic interface , in  which if user have option to create number of text field , if want to 2 or 3 text field , i have created according for each , text field appearing fine, but storing data is a problem in CDT, here i have two field, i field is filled by manager and corresponding field will filled by employee as task.

1 reply

harshitb6843
November 30, 2022

To simplify it, you can add a link to create a new text field below and on that link, you append a null item in the fields of your CDT.
Then you use them to store the value. 

{
  a!forEach(
    items: ri!label,
    expression: a!textField(
      value: fv!item,
      saveInto: fv!item
    )
  ),
  a!richTextDisplayField(
     value: {
       a!richTextItem(
         text: "Add new label",
         link: a!dynamicLink(
           saveInto: a!save(
             ri!label,
             append(ri!label,""))
         )
       )
     }
  )
}