Save row values of one CDT as column values of another CDT

Hi Team,
I have a CDT in the below format : 

id , item id, field name, field value, field seq no where id is the primary key. Eg of values : 

1, 1,  Name, Alex, 1

2, 1, Age, 45, 2

3, 1, DOJ, 2022-04-05 08:56:00, 3

4, 1, Designation, Engineer, 5

Field values in the above CDT are taken from user input in a form.

I have another CDT in below format : 

id, item id, value 1, value 2, value 3, value 4, value 5, value 6

I want the field values from 1st CDT to be saved to value columns of second CDT as per field seq no. 
Like for the above example of CDT 1, my CDT2 should return : 
 
1, 1, Alex, 45, 2022-04-05 08:56:00,  null,  Engineer,  null

How can we achieve this in Appian? Our first preference would be achieving this either in an interface or expression rule. We use process model in back end so we can use that also.
Appian version 21.1

Any suggestions would help us out.

  Discussion posts and replies are publicly visible