# Project Custom Property

**URL:** <https://forum.inductiveautomation.com/t/project-custom-property/47818>\
**Category:** Ignition\
**Created:** [June 16, 2021, 9:31am UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818 "2021-06-16T09:31:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiawei.liu](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jiawei.liu](https://forum.inductiveautomation.com/u/jiawei.liu)\
**Post date:** [June 16, 2021, 9:31am UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/1 "2021-06-16T09:31:35Z")

</div>

I want to define some properties, and these properties can be used in the Project Library, so what ways can I achieve this requirement?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [June 16, 2021, 9:35am UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/2 "2021-06-16T09:35:16Z")

</div>

Perspective?  
Its possible to add custom session properties.  
You can access those by pressing ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/8/285ef5f705d32434e7b343cb4491f1af60a97e00.png) and open the perspective property editor.

---

<div class="post-metadata">

**Author:** ![jiawei.liu](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jiawei.liu](https://forum.inductiveautomation.com/u/jiawei.liu)\
**Post date:** [June 16, 2021, 9:40am UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/3 "2021-06-16T09:40:34Z")

</div>

Yes, Perspective.  
If I add custom session properties, how can I get this properties in Project Library?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 16, 2021, 10:45am UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/4 "2021-06-16T10:45:14Z")

</div>

What exactly do you mean by “Project Library”?

---

<div class="post-metadata">

**Author:** ![jiawei.liu](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jiawei.liu](https://forum.inductiveautomation.com/u/jiawei.liu)\
**Post date:** [June 16, 2021, 12:46pm UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/5 "2021-06-16T12:46:10Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/d/ad0eb93d95a17ea974bbc70b943a5368544c5160.png)

define function in project library, and can get this properties in this function

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [June 16, 2021, 12:58pm UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/6 "2021-06-16T12:58:40Z")

</div>

Does session.custom.myCustomProp work?

If not you can always add session into the function

```auto
def doSomethingWithSession(session):
   print session.custom.myCustomProp

doSomethingWithSession(session)
(could also be self.session idk)

```

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 16, 2021, 9:47pm UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/7 "2021-06-16T21:47:03Z")

</div>

As @victordcq said.  
Also, know that session props are client scoped; changing a value in one client will not change it in another.

If you want the same values across all clients, then you can use memory tags and then read and write to them using `system.tag.writeBlocking/Async`

---

<div class="post-metadata">

**Author:** ![jiawei.liu](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jiawei.liu](https://forum.inductiveautomation.com/u/jiawei.liu)\
**Post date:** [June 17, 2021, 1:07am UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/8 "2021-06-17T01:07:09Z")

</div>

Thank you for your reply.  
except using session and memory tag, is there any other way?  
For example, can set these properties on the gateway or use the config file to set these properties, so that the functions in the Project Library can get it?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 17, 2021, 1:37am UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/9 "2021-06-17T01:37:34Z")

</div>

I’m sure you might be able to use the ignition.conf or another file on the gateway such as an ini and use [ConfigParser](https://www.jython.org/jython-old-sites/docs/library/configparser.html) to read the config.

You can get the ignition install directory using: [How to get Ignition install directory (OS agnostic)? - #3 by nminchin](http://forum.inductiveautomation.com/t/how-to-get-ignition-install-directory-os-agnostic/40456/3)  
Note: this will only work from the gateway scope, so from gateway event scripts, tag change events, etc.  
What are you trying to store?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [June 17, 2021, 6:56am UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/10 "2021-06-17T06:56:37Z")

</div>

Storing things in config files seems not something one should do to much.  
Tags or a database is also always a good option to store things.

---

<div class="post-metadata">

**Author:** ![jiawei.liu](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jiawei.liu](https://forum.inductiveautomation.com/u/jiawei.liu)\
**Post date:** [June 17, 2021, 9:06am UTC](https://forum.inductiveautomation.com/t/project-custom-property/47818/11 "2021-06-17T09:06:18Z")

</div>

I take a shot at it.  
Thank you for your reply.
