how to iterate from list 1 & list 2 values at a time

Certified Associate Developer

Hello Everyone,

Can anyone help me on this, Thanks in Advance.

require to iterate from lists & save in cdt in above format.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hello  

    You do not need to use both the lists to use in the items. You can use the first list to iterate or the 2nd list considering both have the same length of items. 

    a!localVariables(
      local!list1: { "user1", "user2", "user3" },
      local!list2: { "userA", "userB", "userC" },
      a!forEach(
        items: local!list1,
        expression: 'type!yourCDT_here'(
          contentOwners:fv!item,
          qcReviewers:index(local!list2,fv!index,null)
        )
      )
    )

Reply
  • 0
    Certified Senior Developer

    Hello  

    You do not need to use both the lists to use in the items. You can use the first list to iterate or the 2nd list considering both have the same length of items. 

    a!localVariables(
      local!list1: { "user1", "user2", "user3" },
      local!list2: { "userA", "userB", "userC" },
      a!forEach(
        items: local!list1,
        expression: 'type!yourCDT_here'(
          contentOwners:fv!item,
          qcReviewers:index(local!list2,fv!index,null)
        )
      )
    )

Children
No Data