Creating Hybrid CDT list with values from 2 sources

A bit of backgroud,

I need to update a variable in a CDT list in a process. These values come from the DB. All other values filled in the process need to stay the same. 

There must be a better way to do the following:

a!forEach(
  items: ri!FromProcess,
  expression: cast(
    'type!{namespace:com}CustomDataType',
    {
      Id: fv!item.Id,
      A: fv!item.A,
      B: fv!item.B,
      C: ri!FromDb[wherecontains(fv!item, ri!FromDb)].C
    }
  )
)

  Discussion posts and replies are publicly visible