How can I add some static dropdown option in admin from by uiComponent.

I am using this but it's not working.

        <field name="gender">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">
                    <item value="0" xsi:type="string">Doesn't Matter</item>
                    <item value="1" xsi:type="string">Male</item>
                    <item value="2" xsi:type="string">Female</item>
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Gender</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">number</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="source" xsi:type="string">job</item>
                    <item name="dataScope" xsi:type="string">gender</item>
                    <item name="sortOrder" xsi:type="number">60</item>

1 Answer 1


Replace your options item with

           <item name="options" xsi:type="array">
                <item name="0" xsi:type="array">
                    <item name="value" xsi:type="number">0</item>
                    <item name="label" xsi:type="string" translate="true">Doesn't Matter</item>
                <item name="1" xsi:type="array">
                    <item name="value" xsi:type="number">1</item>
                    <item name="label" xsi:type="string" translate="true">Male</item>
                <item name="2" xsi:type="array">
                    <item name="value" xsi:type="number">2</item>
                    <item name="label" xsi:type="string" translate="true">Female</item>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.