List of all enum values

I have an enum with a list of all possible actions inside of the app.
I need to extract each property and make the event from that property

How can list all values inside the enum, so far I get only numbers with string?

Hi @Dava,

There isn’t an API for that but have you tried looking in the browser console what Actions.attributes property holds? There may be something that you can use.

Otherwise you could create your own “enum” and use it when creating the attributes. For example:

Actions.typeEnum = {
   VAL: 'AddValue',
   BET: 'Bet',
   SET: 'SetValue'

Now in your attribute use:

   {'VAL': Actions.typeEnum.VAL},
   {'BET': Actions.typeEnum.BET},
   {'SET': Actions.typeEnum.SET},

You can now get keys like this:

const keys = Object.keys(Actions.typeEnum);

I couldn’t get better solution then this :slight_smile:
@Leonidas thank you

1 Like

@Leonidas I am trying to access to enum from another script, but it gives me errors, do I have javascript syntax mistake here?

Ah, that’s a global variable, so you should access it like this:

this.APP_BET = "APP"+Actions.typeEnum.BET;
1 Like