Hi there,
I am looking to duplicate rows of 1 specific column of a table into another table.
The use case is this; In a previous step, drawings are added. In the next step, users are assigned to all drawing. In the current step I want to change, users must comment on each drawing.
I cannot use the same table as multiple users must comment on each drawing, so my idea was that on page load, I have javascript that looks at each row of the drawings table and clicks the "add" row buttton of the new table and the default "user" field is that of the current logged in user, which works fine if there is 2 drawings added but not anymore.
The issue I'm having is then filling out the drawing field from the first table, and copying it across to the new fields that are added when the "add" button is clicked by my javascript. I also need to find a way to prevent the drawing field being copied over to the new table if comments already exist from another user.
I am trying to think if there's possibly another way that this could be achieved. Would there be a way from Workflow to create a new table with multiple rows for each user based on the number of rows from the initial table? I currently fill out the drawing number for the second table with workflow but it only adds the rows once and not duplicating the drawing numbers for each user
My javascript is below;
//for each row of column docNo $('#q23 .docNo input[type=text]').each(function(value) { var cellText = $(this).val(); //this correctly outputs all the drawing numbers in the DocNo Field alert(cellText); //add the new rows in my new table $('#q3').click(); if(!$('#q4 .engineerDrawing').val() ) { // it moves all the drawing numbers into new fields for some reason rather than appending to the blank as expected $('#q23 .docNo').clone().appendTo('#q4 .engineerDrawing'); } });