Add a drop-down input widget

0
Hello everyone. I've been trying for a few days to find a way to set up a drop-down input widget (I also tried with reference selector), but it doesn't work. I have a NaturalPersonData persistable entity, and in it, one of the attributes I want to display in the drop-down widget is a LeagalStatus attribute of type string (which would only have two values – Active and Inactive). What I tried: To use the drop-down widget, I added a new LegalStatus attribute of the enumeration type, which in my case leads to a "conflict" because my domain model was formed after export mapping using the JSON structure (meaning it requires a LegalStatus string attribute). I tried with this example https://community.mendix.com/link/questions/107236 from @MarcoSpoel (in short: to pars enumeration in a string), but I still get an error. Please help!Many thanks.  
asked
3 answers
0

Changing the type to an Enumeration sounds like the correct approach, especially if it can only be two fixed values.

You can change your Export Mapping so that field can be converted using a “Convert using” Microflow to return a string that can be exported in the JSON.

Good luck!
 

answered
0

Hi Petar,

Try getKey($NaturalPersonData/LegalStatusEnum). I gave not the best answer in my previous one. The difference between getKey and getCaption is explained here. 

 

(Probably getCaption raised the error because it was not translated yet)

 

With regards,

Marco

answered
0

Thank you for the answer, I will try both ways.

answered