Has anyone had such a case where they had to make a copy of an element and place it as a subitem to another element?
Maybe someone has a query for this case, I will be grateful. Of course, if this is not possible, I will be grateful for an answer.
The second question is - is it possible to add elements via the API as mirrored fields?
In this case I believe you would need to query for the column values of the subitem and then create the subitem from scratch under the new parent item via “create_subitem”.
Because you can duplicate subitems but the duplicate will appear under the same parent item as the original subitem. And then you can not “move it” to a different parent item.
Regarding the second question, what would an example of this be?
So, how to manage that?
via query mutation create_new_subitem i get only 3 columns → Owner,Status,Date
In the documentation, there is also information about column_values but no sample of how to use that.
I’ve tried that but its only create item with name New Subitem mutation { create_subitem( parent_item_id: [my_item_id] item_name: "New Subitem" column_values: "{\"New Column\": \"Column Value\", \"Another Column\": \"Another Value\"}" ) { id } }
About mirrored fields, I’d like to match 2 different boards data via API. It’s possible?
You have to use the column’s IDs and not their names. To get the column IDs, you can do so by clicking on your profile picture or initials at the bottom left of the screen, then clicking on monday.labs and then enabling developer mode. After that if you go to your board and click on the three dots next to your columns’ titles, you will see each ID.
You can also check them out with a query like this one:
{
boards(ids:1234567890){
columns{
title
id
}
}
}
You will need to pass the column values of each column in a different format depending on each column type. You can find the documentation here.