Create an Item and Subitems in one move using GraphQL mutation

I have a flat table with row data. From that, I want to create parent items and their respective subitems. I made up a store example. I want to track the things I receive for my store in a board where the item (parent) is the Box, and in it can be one or multiple different items (subitems). I’m looking for a starting point or suggestions- do I first create the items, store the parent item ids somewhere, then loop back and create the subitems for each? Or can I do it all ‘in one move’ as I iterate through the list. I’m actually working in VBA but Python code would be helpful too. Here’s a graphic:


hi @jsararas

You need to create the item first. The create_item mutation return the itemId of the item created. This itemId can then be used to create the subitems.

1 Like