foreach record update record field with index

Certified Senior Developer

I wanted to update record field with fv!index.

I have

Recrod type

filed1,

field2,

field3

field3 should update with foreach index

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    Hi  ,

    if you are referring to update a single field of a record type in a!foreach() using fv!index,this could be possible.



    You need to write saveInto to rule input inorder to pass data from interface to PM if using action.

    a!localVariables(
      local!data: index(
        rule!HDS_getRequestData(returnData: true()),  /*use your rule*/
        enumerate(5) + 1
      ),
      a!forEach(
        items: { 1, 2, 3, 4, 5 },
        expression: a!update(
          local!data,
          recordtype!HDS Request.assetId,   /*use field*/
          fv!index
        )
      )
    )

Reply
  • 0
    Certified Associate Developer

    Hi  ,

    if you are referring to update a single field of a record type in a!foreach() using fv!index,this could be possible.



    You need to write saveInto to rule input inorder to pass data from interface to PM if using action.

    a!localVariables(
      local!data: index(
        rule!HDS_getRequestData(returnData: true()),  /*use your rule*/
        enumerate(5) + 1
      ),
      a!forEach(
        items: { 1, 2, 3, 4, 5 },
        expression: a!update(
          local!data,
          recordtype!HDS Request.assetId,   /*use field*/
          fv!index
        )
      )
    )

Children
No Data