Stumped on setting state with a "thing"

I have a thing associated with each item in my element. When you click on it, I want to set the “last_selected_node” state field. My element is based on a Jquery plugin and has an event handler for clicking that looks like the code below. I have tried it both with a stored “thing” and with a new “thing” gotten from the databse APi (this latest version.) In either case when I call publishState with the “thing” object I get the exception below the code.

Help?

Code:

inst.on(“select_node.jstree”, function (e, data) {
console.log(“node selected”);
GetBubbleRecord(data.node.data.bubble_node_id,result => {
instance.publishState(‘last_selected_node’,result);
instance.triggerEvent(“item_selected”);
})
});

Exception:

Calling evaluate_property outside of an autorun or watcher
at e.evaluate_property (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:18:112178)
at o (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:18:474941)
at C (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:18:475060)
at a (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:18:477444)
at T (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:18:466263)
at https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:18:477556
at e.state (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:18:116203)
at https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:18:473043
at T (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:18:466263)
at Object.M.t.publishState (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:18:472938)
at eval (PLUGIN_TreeView–testing–initialize–TreeView-.js:48:23)
at Object.eval [as success] (PLUGIN_TreeView–testing–initialize–TreeView-.js:7:16)
at i (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:2:27983)
at Object.fireWith [as resolveWith] (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:2:28749)
at A (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:4:14203)
at XMLHttpRequest. (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/5cdb5580cdfd657a3ccecc3977dd78141ae56c6385d278b54c4aea96fdb49973/xfalse/x9:4:16491)
.

I figured it out. There is an asymmetry in bubble’s javascript API.

AppType input fields return the actual record data, however AppType output fields require the ID of the record.

This should be much better documented.