after spending 2 days trying to figure out how to use setIn() to insert Key Value pairs into a temporary state I figured I'd try to help others.
The biggest piece holding me back was initial value as if you set initial value of the temp state to 0 or null you can not properly use setIn
Please set your initial value to {} in order to declare it as an object in turn allowing setIn to work properly.
here is an example of a Table event handler for row click - run script where i declare keys and values into a temp state that is passed to a Module in which i can configure which buttons to show or hide as well as which invoice template to use for the desired company in quickbooks, it is still in development and will end up with many more keys as I go but as it took me a lot of digging to figure it out I'm hoping I can speed up the process for others.
stae1.setIn(["formstate"], 1)
stae1.setIn(["invoicetemplate"], "1")
stae1.setIn(["object2","nestedkey"], "num6") <-- and example of nested key insert
tabbedContainer1.setCurrentView("View 5")
the video that really helped me out is here