# Failing to save session scripts and custom properties

**URL:** <https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378>\
**Category:** Ignition Early Access\
**Created:** [March 15, 2019, 1:44pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378 "2019-03-15T13:44:21Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![SMcIntosh](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@SMcIntosh](https://forum.inductiveautomation.com/u/SMcIntosh)\
**Post date:** [March 15, 2019, 1:44pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/1 "2019-03-15T13:44:21Z")

</div>

I’ve noticed that if I make any changes to the Perspective session properties (add a custom property, add a property change script, add a binding to a custom property) none of the changes are saved with the project. So I can’t add my own custom properties unless I have a script run to do it in every session - and then can’t add property change scripts or bindings to that property. Is there a different way to go about performing an action when a session property changes?

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [March 15, 2019, 1:49pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/2 "2019-03-15T13:49:56Z")

</div>

What’s the build number? Some of these things were fixed recently.

---

<div class="post-metadata">

**Author:** ![SMcIntosh](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@SMcIntosh](https://forum.inductiveautomation.com/u/SMcIntosh)\
**Post date:** [March 15, 2019, 1:51pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/3 "2019-03-15T13:51:46Z")

</div>

8.0.0-beta0 (b2019031502)

---

<div class="post-metadata">

**Author:** ![amadrid](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@amadrid](https://forum.inductiveautomation.com/u/amadrid)\
**Post date:** [March 15, 2019, 7:45pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/4 "2019-03-15T19:45:20Z")

</div>

This sounds a bit like an issue I have run into, see if this doesn’t help as a workaround for the time being.  
[http://forum.inductiveautomation.com/t/bug-designer-edits-not-being-saved-implemented/23299](http://forum.inductiveautomation.com/t/bug-designer-edits-not-being-saved-implemented/23299)

---

<div class="post-metadata">

**Author:** ![nburt](https://avatars.discourse-cdn.com/v4/letter/n/2bfe46/32.png) [@nburt](https://forum.inductiveautomation.com/u/nburt)\
**Post date:** [March 20, 2019, 5:13pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/5 "2019-03-20T17:13:11Z")

</div>

I am also having this issue. In perspective I can create a SESSION CUSTOM property like I can on any other view, but I cannot save this change. Saving shows ‘No changes to save’ in the bottom left corner and closing and opening the designer wipes any custom session property I added.

The workaround, restarting the ignition server, did not work for me as of the latest build `8.0.0-beta0 (b2019032002)

---

<div class="post-metadata">

**Author:** ![awalker](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awalker/32/6874_2.png) [@awalker](https://forum.inductiveautomation.com/u/awalker)\
**Post date:** [March 27, 2019, 5:24pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/6 "2019-03-27T17:24:12Z")

</div>

Hi -

Are you all still seeing this issue on the latest build?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 27, 2019, 5:50pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/7 "2019-03-27T17:50:28Z")

</div>

If you ARE still seeing this, could you supply the view.json file for the offending View, as well as the content you are ATTEMPTING to supply in the same post?

For example:

 ![57%20AM](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e510e18d822665700bc5ae1d5cd90fda2360c4d4.png)

---

<div class="post-metadata">

**Author:** ![SMcIntosh](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@SMcIntosh](https://forum.inductiveautomation.com/u/SMcIntosh)\
**Post date:** [March 27, 2019, 6:38pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/8 "2019-03-27T18:38:41Z")

</div>

Yes, this is still happening on today’s build. Right now I’m trying to make a new property session.custom.plant with a value of 1.

[props.json](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/93551c0c63671ddc3a7456e33c3e39b6fb3537ec.json) (812 Bytes)

It’s not on a view, it’s on the session. As you can see, we actually created a script on the “authenticated” property at one point - but that script is no longer visible or accessible from the designer. It’s still working but can’t be edited or seen except from the file on the gateway.

Here’s what my session props look like in the designer when I first start the designer session (no script visible on authenticated):  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/8b148733791347f028d00930596bee3dc8242a68.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 27, 2019, 7:10pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/9 "2019-03-27T19:10:21Z")

</div>

Following these steps:  
Create a New Project.  
Replace

```auto
Inductive Automation\Ignition\data\projects\<project_name>\com.inductiveautomation.perspective\session-props\props.json

```

with the provided `props.json` file.  
Open Designer.

I can see your script in place.  
After modifying your script to include logging (irrelevant - I just wanted to modify it to see if it would save) and adding in a `session.custom` property “plant” and setting its value to 1, I saved the Project, quit the Designer, and re-opened the Designer and the script was still present, as was the new custom property.

**Next steps:**  
Do you have any Session OnStartup/onShutdown scripts in place?  
Is this a child project, a parent project, or a stand-alone project?  
Do you have any File Explorer/Finder windows open to the directory which contains the `props.json` file?

---

<div class="post-metadata">

**Author:** ![SMcIntosh](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@SMcIntosh](https://forum.inductiveautomation.com/u/SMcIntosh)\
**Post date:** [March 27, 2019, 7:56pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/10 "2019-03-27T19:56:47Z")

</div>

Following your next steps:

- I do have an onStartup session script. It creates the custom property that I was unable to save, so the same property is generated each time the session starts.
- The project is a child project.
- No.

The fact that it’s a child project appears to be what is causing the problem! When I save the custom property on a new, stand alone project it works as expected - when I create a new child project under the auto-generated “global” project, I can’t save custom properties to it.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 27, 2019, 8:36pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/11 "2019-03-27T20:36:43Z")

</div>

Unfortunately, almost all of the QA projects are children of a “global” project, and they do not exhibit this issue, so it’s unlikely the result of your project being a child of the “global” project, unless yours contains something which other user’s projects do not.

What makes this even MORE unlikely is that Session props are only inherited during project conception - so inheritance shouldn’t factor in here.

Is your Session startUp script anything other than `session.custom.plant = 1` ?

Session startUp scripts ARE inherited… Does your Parent project have any Session startUp/shutDown scripts?

---

<div class="post-metadata">

**Author:** ![SMcIntosh](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@SMcIntosh](https://forum.inductiveautomation.com/u/SMcIntosh)\
**Post date:** [March 27, 2019, 9:31pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/12 "2019-03-27T21:31:00Z")

</div>

The parent project does not have any Session Event scripts. The only thing in the global project is shared scripts.

In the child session startup script there is a bit more going on right now, stuff we might add to a binding if we could create the property:

```auto
gateway = session.props.gateway.address
assigned_plant = project.dbFunctions.getAssignedPlant(gateway)
session.custom.plant = assigned_plant

type_ds = system.dataset.toDataSet(['Value'], [['SAMPLE']])
type_array = shared.jsonArray.dropdownDataSetToOptions(type_ds)
session.custom.sampleTypes = type_array

```

Here’s our global session props, if that’s useful:  
[props.json](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4d7998b6c68017a6d40adcc1def8232902894f72.json) (499 Bytes)

---

<div class="post-metadata">

**Author:** ![nburt](https://avatars.discourse-cdn.com/v4/letter/n/2bfe46/32.png) [@nburt](https://forum.inductiveautomation.com/u/nburt)\
**Post date:** [March 28, 2019, 3:33pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/13 "2019-03-28T15:33:37Z")

</div>

> [@cmallonee](#):
>
> What makes this even MORE unlikely is that Session props are not inherited - so inheritance shouldn’t factor in here.

I created a stand alone project called TEST\_PARENT, edited the project.json file to set "inheritable": true which then allowed me to create a child project called TEST\_CHILD\_OF\_PARENT from TEST\_PARENT.

After saving CHILD I can see that its session-props/props.json file is exactly the same as PARENT's, specifically it included my custom property:  
"custom": {  
"testing": "value"  
}

This doesn't sound like it should be expected does it?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 28, 2019, 3:55pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/14 "2019-03-28T15:55:43Z")

</div>

I mis-spoke when I said they aren’t inherited. What I meant to convey is that CHANGES to a Parent Project’s Session Properties are not conveyed to children which already exist, as this could obliterate a child project’s values.

So after the child project has been created, you will not see Session Property changes in the parent also appear in the child. This behavior is different then if you were to make a new View in a Parent Project, as that View WOULD be visible/usable by any children.

I’ll edit the older post for clarity.

---

<div class="post-metadata">

**Author:** ![nburt](https://avatars.discourse-cdn.com/v4/letter/n/2bfe46/32.png) [@nburt](https://forum.inductiveautomation.com/u/nburt)\
**Post date:** [March 28, 2019, 4:54pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/15 "2019-03-28T16:54:35Z")

</div>

I think I found the solution. The session-props\resource.json was the culprit. Our project had “overridable” set to false and I noticed that all the new parent projects I created had that set to true.

I’m not sure why this had changed though. It definitely wasn’t something we manually changed ourselves.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 28, 2019, 5:02pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/16 "2019-03-28T17:02:52Z")

</div>

Ah, I’m betting that Parent project is back from the VERY early days of the Beta - before we set the default for overridable to True. There was a script floating around that fixed the issue by finding all overridable properties and swapping them to True, but it sounds like you’ve been skirting the issue this whole time.

@SMcIntosh: Does your accompanying resource.json include the same value for “overridable”?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 28, 2019, 5:03pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/17 "2019-03-28T17:03:37Z")

</div>

Replace the value in question with `true` and see if that resolves the issue.

---

<div class="post-metadata">

**Author:** ![SMcIntosh](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@SMcIntosh](https://forum.inductiveautomation.com/u/SMcIntosh)\
**Post date:** [March 28, 2019, 5:07pm UTC](https://forum.inductiveautomation.com/t/failing-to-save-session-scripts-and-custom-properties/23378/18 "2019-03-28T17:07:20Z")

</div>

Yes, issue resolved (“overridable”, not “inheritable” though). Thank you everyone for the help!
