How to show dropdown data from rest api

0
Dear experts, I am having trouble binding drop-down data to an API in a Form. I have created a Form entity with a form field of type Enumeration, but there is no option to get data from an API in the Enumeration type. Can you please help me with this?
asked
2 answers
3

Hi Vinay,

For this, you can use the same Enum (if you already have an idea about the value of enums) you are using in the server app, and then you can directly map the incoming string into the enum itself,

 

You cannot create an ENUM dynamically,

If you want to do it dynamically, you can use the approach suggested by András Oszvald abov,

 

Let me know, if you have any issues,

Hope it helps!!

answered
0

Hi Vinay,

As far as I understand changing Enumeration values is not an option in runtime. However you could create an Entity representing your Enumeration, populate it from your API source and set a 1-* reference to your Form entity. This way you can use a Reference Selector with the default drop-down option. (https://docs.mendix.com/refguide/reference-selector/)

Hope this helps!
Best of luck!
András

answered