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

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

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

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.

What am I doing wrong?

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.

If you mean clicking here:

…then that was exactly what I did.

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

to this: (selection type Basic)

…saving the selected enum on value change.

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


While the other setup gives:

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.

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?