# Assigne / manipulate \`grok.shell.project\`

**URL:** <https://community.datagrok.ai/t/assigne-manipulate-grok-shell-project/710>\
**Category:** Questions\
**Tags:** javascript\
**Created:** [January 9, 2023, 2:48pm UTC](https://community.datagrok.ai/t/assigne-manipulate-grok-shell-project/710 "2023-01-09T14:48:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas.g.business](https://community.datagrok.ai/letter_avatar_proxy/v4/letter/a/87869e/32.png) [@andreas.g.business](https://community.datagrok.ai/u/andreas.g.business)\
**Post date:** [January 9, 2023, 2:48pm UTC](https://community.datagrok.ai/t/assigne-manipulate-grok-shell-project/710/1 "2023-01-09T14:48:32Z")

</div>

Is there a way to control or manipulate the `grok.shell.project` value programatically?

Context: Our use case is to either open an existing project or create a new project and work with this. On open an existing project, new opened project gets assigned to `grok.shell.project`. However when we create a new project we cannot assign this to `grok.shell.project` (this variable always points to “Scratchpad” project)?

---

<div class="post-metadata">

**Author:** ![alex.paramonov](https://community.datagrok.ai/user_avatar/community.datagrok.ai/alex.paramonov/32/9_2.png) [@alex.paramonov](https://community.datagrok.ai/u/alex.paramonov)\
**Post date:** [January 9, 2023, 2:59pm UTC](https://community.datagrok.ai/t/assigne-manipulate-grok-shell-project/710/2 "2023-01-09T14:59:13Z")

</div>

Right now no.  
It was designed as a read-only property, and “scratchpad-based” logic is based on UI behavior.  
I suppose, you are trying to create a new project and set it as default or open?  
I think we can support case when you create project on client-side, and open it, is it the case?

---

<div class="post-metadata">

**Author:** ![andreas.g.business](https://community.datagrok.ai/letter_avatar_proxy/v4/letter/a/87869e/32.png) [@andreas.g.business](https://community.datagrok.ai/u/andreas.g.business)\
**Post date:** [January 9, 2023, 3:06pm UTC](https://community.datagrok.ai/t/assigne-manipulate-grok-shell-project/710/3 "2023-01-09T15:06:45Z")

</div>

Yes exactly that’s my main use case. However as long as the Scratchpad project is assigned to `grok.shell.project` the new project is not assigned to this var (tried already to call newProject.open() as workaround).

---

<div class="post-metadata">

**Author:** ![alex.paramonov](https://community.datagrok.ai/user_avatar/community.datagrok.ai/alex.paramonov/32/9_2.png) [@alex.paramonov](https://community.datagrok.ai/u/alex.paramonov)\
**Post date:** [January 9, 2023, 3:46pm UTC](https://community.datagrok.ai/t/assigne-manipulate-grok-shell-project/710/4 "2023-01-09T15:46:28Z")

</div>

Both should work. newProject.open() and .project = newProject, it’s a bug

---

<div class="post-metadata">

**Author:** ![alex.paramonov](https://community.datagrok.ai/user_avatar/community.datagrok.ai/alex.paramonov/32/9_2.png) [@alex.paramonov](https://community.datagrok.ai/u/alex.paramonov)\
**Post date:** [January 9, 2023, 3:47pm UTC](https://community.datagrok.ai/t/assigne-manipulate-grok-shell-project/710/5 "2023-01-09T15:47:44Z")

</div>

BTW, what do you expect as an active project? Where do you use it? If you have newProject and can open it, it should be enough

---

<div class="post-metadata">

**Author:** ![andreas.g.business](https://community.datagrok.ai/letter_avatar_proxy/v4/letter/a/87869e/32.png) [@andreas.g.business](https://community.datagrok.ai/u/andreas.g.business)\
**Post date:** [January 11, 2023, 7:21am UTC](https://community.datagrok.ai/t/assigne-manipulate-grok-shell-project/710/6 "2023-01-11T07:21:39Z")

</div>

So basically I was expecting to `grok.shell.project` to be the reference to the latest opened project. We need this as we create new project on the fly and use it to save the dataframes (and later view layouts) to it!?

As a workaround for now, we keep track of the project reference by our self but that should be only a workaround until this gets fixed!

---

<div class="post-metadata">

**Author:** ![alex.paramonov](https://community.datagrok.ai/user_avatar/community.datagrok.ai/alex.paramonov/32/9_2.png) [@alex.paramonov](https://community.datagrok.ai/u/alex.paramonov)\
**Post date:** [January 12, 2023, 8:12am UTC](https://community.datagrok.ai/t/assigne-manipulate-grok-shell-project/710/7 "2023-01-12T08:12:20Z")

</div>

Fixed in 1.12.0,  
now you can open newly created project, and grok.shell.project indicate latest project.

Also, issue with Project’s list in children list is fixed.
