# How to get the self-defined integer value of an enumeration in a function?

**URL:** <https://community.appfarm.io/t/how-to-get-the-self-defined-integer-value-of-an-enumeration-in-a-function/1579>\
**Category:** Ask the community\
**Created:** [January 8, 2025, 11:39am UTC](https://community.appfarm.io/t/how-to-get-the-self-defined-integer-value-of-an-enumeration-in-a-function/1579 "2025-01-08T11:39:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lbj](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/lbj/32/82_2.png) [@lbj](https://community.appfarm.io/u/lbj)\
**Post date:** [January 8, 2025, 11:39am UTC](https://community.appfarm.io/t/how-to-get-the-self-defined-integer-value-of-an-enumeration-in-a-function/1579/1 "2025-01-08T11:39:47Z")

</div>

I’m having a enumeration for Map Coordinate systems for conversion and each item in the enumeration corresponds to an EPSG integer value.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/5/5f42ec9c8646ce156585033d407675a4573bb7d9.png)

The enum is used on a select component from the following property:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/a/a1498a77df07bd190b08355827fa5ab0d4783a6e.png)

When I’m trying to use that enum in a function, I only get back the guid of the enum. I don’t know how I can access the actual integer value. If I use ${coordinateSystem.value} I get undefined.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/6/694fe4e88bfd50fb2b9d62993567b226bf4de55e.png)

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [January 8, 2025, 12:03pm UTC](https://community.appfarm.io/t/how-to-get-the-self-defined-integer-value-of-an-enumeration-in-a-function/1579/2 "2025-01-08T12:03:33Z")

</div>

Hi!

If you add the property `Site.Coordinate System` as a function param, you are adding the ID reference to that enum. It is the same as adding an object reference as a function parameter. And when adding _properties_ as function params, you cannot use “dot notation” to propagate oout to the reference object/enum’s properties (only works one level out when adding data sources as function params, e.g. `person.firstName` may be referenced if `person` is a data source added as function param)

If you instead add `Site.Coordinate System.Value` as function parameter, you will not get undefined, but the Integer Value of that reference enum.

---

<div class="post-metadata">

**Author:** ![lbj](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/lbj/32/82_2.png) [@lbj](https://community.appfarm.io/u/lbj)\
**Post date:** [January 8, 2025, 12:49pm UTC](https://community.appfarm.io/t/how-to-get-the-self-defined-integer-value-of-an-enumeration-in-a-function/1579/3 "2025-01-08T12:49:22Z")

</div>

If you mean clicking here:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/e/e942d3688a6c0e58ddfdbd0e555e839f6517b55c.png)

…then that was exactly what I did.

I found a working fix by changing the logic from this setup: (selection type Property)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/b/be5ad02c1bd02481ec82c81c45f486eaf4e466c6.png)

to this: (selection type Basic)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/5/540cb882817e98bc716b78ef2c7593ed977de800.png)

…saving the selected enum on value change.

In the first setup, the debugger reports this on Coordinate system:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/2/27139428a786ceae05bc96ab46bea1a88af34e27.png)  
While the other setup gives:  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/8/81360267a7946813effbd45a7d627f5f8dfda0b6.png)

In the second setup the value of the enum is returned as expected in functions while the first setup doesn’t seem to work. There might be a logical explanation for this, but for me, it seems like a bug.

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [January 9, 2025, 7:03pm UTC](https://community.appfarm.io/t/how-to-get-the-self-defined-integer-value-of-an-enumeration-in-a-function/1579/4 "2025-01-09T19:03:56Z")

</div>

Hi!

I test this case in a standalone app in your solution, and it works as expected. Do you still experience this behaviour? I see that you have selected the enumerated type data source `Coordinate Systems` in the **Options** setting of the select (the one with selection type **Property** ). The should work under normal circumstances, but it is not necessary since it is an enum. Can you try to remove that data source from the Options setting?
