Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Combobox show label instead of value

ihm185
Level 4
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
ihm185
Correct answer by
Level 4
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
pablo_rosero1
Level 10
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

ihm185
Correct answer by
Level 4
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