Expand my Community achievements bar.

SOLVED

Enumerations in Xml

Avatar

Level 5

How can I create an enumeration that if I pass the value 1 is equal to Yes and if I pass the value 2 is equal to No, all this in XML code.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

In Schema, with the above mentioned enum structure, try the same by replacing the enum attribute as below (defining type as byte)

 <enumeration basetype="byte" name="myEnum">
    <value label="Yes" name="yes" value="1"/>
    <value label="No" name="no" value="2"/>
  </enumeration>
<attribute enum="myEnum" label="My Enum" name="abcd" type="byte"/>

  

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @alnavarg , You can try this in schema

  <enumeration basetype="byte" name="myEnum">
    <value label="Yes" name="yes" value="1"/>
    <value label="No" name="no" value="2"/>
  </enumeration>

Avatar

Level 5

This does not work I have the code like this then I pass a Sql Code activity with that code and it fills it is 1 and 2 and I want Yes and no but passing it 1 and 2.

alnavarg_1-1681213182436.png

 

alnavarg_0-1681213140225.png

alnavarg_2-1681213216824.png

 

Avatar

Correct answer by
Community Advisor

In Schema, with the above mentioned enum structure, try the same by replacing the enum attribute as below (defining type as byte)

 <enumeration basetype="byte" name="myEnum">
    <value label="Yes" name="yes" value="1"/>
    <value label="No" name="no" value="2"/>
  </enumeration>
<attribute enum="myEnum" label="My Enum" name="abcd" type="byte"/>