Populate data from one RecordType to another RecordType

I have a RecordType STG with multiple Records in it. I need to have that data inserted/copied to another RecordType TARGET. Both have the same columns and data types defined in them.

With the exception of Unique Identifiers  (ID Column) in both the Tables, I want the rest of all columns data to be moved from STG to Target.

Can you please advise on how we can do this. I was thinking Script Task in a process model, but need some guidance on this.

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    You could create a rule (i.e. CopyRecords) that takes a list of the Record Type as input and returns a list of the target Record type:

    a!localVariables(
      local!records: ri!S_Records_Source,
      local!recordsMap: cast(
        a!listType(typeof(a!map())),
        local!records
      ),
      local!recordsMapWithNoIdentifiers: a!update(local!recordsMap, { "id" }, { null }),
      cast(
        a!listType(
          'recordType!{e10c73fb-040d-4dc2-bd0d-64ba11097acc}S_Record_Target'
        ),
        local!recordsMapWithNoIdentifiers
      )
    )

Reply
  • +1
    Certified Lead Developer

    You could create a rule (i.e. CopyRecords) that takes a list of the Record Type as input and returns a list of the target Record type:

    a!localVariables(
      local!records: ri!S_Records_Source,
      local!recordsMap: cast(
        a!listType(typeof(a!map())),
        local!records
      ),
      local!recordsMapWithNoIdentifiers: a!update(local!recordsMap, { "id" }, { null }),
      cast(
        a!listType(
          'recordType!{e10c73fb-040d-4dc2-bd0d-64ba11097acc}S_Record_Target'
        ),
        local!recordsMapWithNoIdentifiers
      )
    )

Children