for a list it return all value, but if i add attribute under it, it just keep return multiple value of the list first value

As pictures show, i wish to save all list of value to database, but once i add attribute under it, it one keep returning value of the list's first value, why? Is this the defect of appian software it self?

  Discussion posts and replies are publicly visible

Parents
  • Alternate way to avoid any loops is to use updateCdt() function. Just use updateCdt to update fields/CDT attributes that do not have direct mappings  before saving them into your rule input. For instance based on your screenshot seems like only (.user) attribute is set from another local but other attributes are directly mapped, so in this case code snippet be like -

    a!save(
      ri!csetenderphases,
      updatecdt(
        local!csetenderphases,
        {
          user: repeat(count(local!csetenderphases), local!newUser)
        }
      )
    )

  • load(
      local!data:{
        rule!KONE_Development_trail_flatten("song","wang")
      },
    
      local!updateColumn: tointeger(
        updatearray(
          local!data.user,
          a!forEach(
            items:rule!KONE_Development_CSE_TENDER_PHASES_Rule(),
            expression:fv!item.id
          ),
          a!forEach(
            items:rule!KONE_Development_CSE_TENDER_PHASES_Rule(),
            expression:fv!item.id
          ),
        )
      ),
    
      updatecdt(
        local!data,
        {
          user:{(local!updateColumn)}
        }
      )
      )

    But it is always report,Expression evaluation error at function 'updatearray' [line 7]: The indices are not of the expected type. Type of indices: List of Variant. Type expected: List of Number (Integer)

Reply
  • load(
      local!data:{
        rule!KONE_Development_trail_flatten("song","wang")
      },
    
      local!updateColumn: tointeger(
        updatearray(
          local!data.user,
          a!forEach(
            items:rule!KONE_Development_CSE_TENDER_PHASES_Rule(),
            expression:fv!item.id
          ),
          a!forEach(
            items:rule!KONE_Development_CSE_TENDER_PHASES_Rule(),
            expression:fv!item.id
          ),
        )
      ),
    
      updatecdt(
        local!data,
        {
          user:{(local!updateColumn)}
        }
      )
      )

    But it is always report,Expression evaluation error at function 'updatearray' [line 7]: The indices are not of the expected type. Type of indices: List of Variant. Type expected: List of Number (Integer)

Children
No Data