Developer forum

Forum » Rapido »  Dropdown List fields (in Item type settings) are returning the "Option Label" instead of the "Option Value"

Dropdown List fields (in Item type settings) are returning the "Option Label" instead of the "Option Value"

Lara Arsénio
Reply

Hello.

The  Dropdown List fields (Item type settings) are returning the "Option Label" instead of the "Option Value".

I have tried to call the value in 2 different ways, but I always get the option label returned instead of the value.

Pageview.AreaSettings.GetItem("Rizzo").GetValue("QuantityPricesFormat").ToString();
Pageview.AreaSettings.GetItem("Rizzo").GetString("QuantityPricesFormat")

The screenshot of the field options is bellow.

Seems like a bug, can you check?

Thanks in advance

BugLabelVsValue.PNG

Replies

 
Karsten Thuen Dynamicweb Employee
Karsten Thuen
Reply
This post has been marked as an answer

Hi Lara

Here is how to get the correct value from an ItemType field that is a list:

Pageview.AreaSettings.GetItem("Rizzo").GetList("QuantityPricesFormat").SelectedValue

 

If you have Visual Studio correctly set up, you should get code hinting, telling you what is available in the viewmodels. 

https://doc.dynamicweb.com/rapido/development/development/customizing-rapido#sideNavTitle1-1

 

Best regards
Karsten Thuen

Votes for this answer: 1
 
Lara Arsénio
Reply

Hi Karsten. I was missing the usage of GetList() for that field, which worked perfectly. 

Thank you

 

You must be logged in to post in the forum