Expand my Community achievements bar.

SOLVED

Combobox show label instead of value

Avatar

Level 4

Hi everyone,

I am pulling data from a field in DB and filling up a combo box. I want to show a different label instead of value. Even after making changes in the label, the value is still displayed. How can I force the label to be displayed in dropdown instead of value?

Please help me.

1 Accepted Solution

Avatar

Correct answer by
Level 4

Thank you for replying Pablo,

After I changed the label values from the frontend, the XML code looks like this.

<container colcount="1" colspan="1" id="container903" label="R1" labelPosition="inherit" style="container" type="container">

    <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list" />

    <input action="refresh" colspan="1" dateEditor="jsCalendar" enabledWhenHistory="false" id="input934" label="What solution can we help you with?*" labelPosition="inherit" required="true" targetSchema="schema:Name" targetSchemaMode="xpath" type="select">

    <storage dateFormat="DDMNY4" enum="product_interest" firstYear="1920" lastYear="2015" mode="xpath" timeFormat="none" type="string" unbound="false" useLabelAsValue="false" userEnum="" xpath="@product_interest">

        <variable xpath="jv" />

        <options>

            <option autoSqlName="true" id="IDforThisField12" label="(None specified)" origin="product_interest:" value="" />

            <option autoSqlName="true" id="IDforThisField13" label="Vendor" origin="product_interest:Digital" value="Digital" />

            <option autoSqlName="true" id="IDforThisField14" label="Operation" origin="product_interest:Software" value="Software" />

            <option autoSqlName="true" id="IDforThisField15" label="Learning" origin="product_interest:Study" value="Study" />

            <option autoSqlName="true" id="IDforThisField16" label="Agenda" origin="product_interest:Planning" value="Planning" />

        </options>

    </storage>

    <contextOptions useContext="0" xpath="productGroupEnum/enumValue-collection/enumValue" xpathLabel="@label" xpathValue="@name" />

    <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list" />

    </input>

</container>

Here we can see that the label is different from the value, but when the form loads in the browser its showing values instead of the label. This happens when we are storing/retrieving the value from db field but in case of storing the value to a variable it works perfectly and we can display a different label from value.

Best regards,

Imran

View solution in original post

2 Replies

Avatar

Level 10

Hi Imran,

This is done by changing label="name" in the code.

See Modifying Factory Forms in Adobe Campaign Classic |

I hope this helps!

All the best,

Pablo

Avatar

Correct answer by
Level 4

Thank you for replying Pablo,

After I changed the label values from the frontend, the XML code looks like this.

<container colcount="1" colspan="1" id="container903" label="R1" labelPosition="inherit" style="container" type="container">

    <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list" />

    <input action="refresh" colspan="1" dateEditor="jsCalendar" enabledWhenHistory="false" id="input934" label="What solution can we help you with?*" labelPosition="inherit" required="true" targetSchema="schema:Name" targetSchemaMode="xpath" type="select">

    <storage dateFormat="DDMNY4" enum="product_interest" firstYear="1920" lastYear="2015" mode="xpath" timeFormat="none" type="string" unbound="false" useLabelAsValue="false" userEnum="" xpath="@product_interest">

        <variable xpath="jv" />

        <options>

            <option autoSqlName="true" id="IDforThisField12" label="(None specified)" origin="product_interest:" value="" />

            <option autoSqlName="true" id="IDforThisField13" label="Vendor" origin="product_interest:Digital" value="Digital" />

            <option autoSqlName="true" id="IDforThisField14" label="Operation" origin="product_interest:Software" value="Software" />

            <option autoSqlName="true" id="IDforThisField15" label="Learning" origin="product_interest:Study" value="Study" />

            <option autoSqlName="true" id="IDforThisField16" label="Agenda" origin="product_interest:Planning" value="Planning" />

        </options>

    </storage>

    <contextOptions useContext="0" xpath="productGroupEnum/enumValue-collection/enumValue" xpathLabel="@label" xpathValue="@name" />

    <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list" />

    </input>

</container>

Here we can see that the label is different from the value, but when the form loads in the browser its showing values instead of the label. This happens when we are storing/retrieving the value from db field but in case of storing the value to a variable it works perfectly and we can display a different label from value.

Best regards,

Imran