Visibility Condition Based on Reference Input

0
Hi I need some advice on how to make elements on a form be visible based on the selections from a drop down. For example I have a contact form. On the form I have a drop down to select the contact method (eg telephone or email). If telephone is selected I want to show some extra fields (Country, Dial code and a data field) if it is an email I just want to show the data field. The visibility table in the properties for widgets appears only to allow hiding based on dates and booleans of items on the immediately available object (not associated objects). Is there's another way to achieve this?
asked
2 answers
2

You could also use this app: https://appstore.home.mendix.com/link/app/2539/First-Consulting/ShowByCondition

Regards,

Ronald

answered
0

Sean,

You can set visibility based on Booleans and Enumerations of the current object, in your case Contact. You could either:

  • make ContactMethod an enumeration on your Contact entity and use it to control display as you wish, or
  • make ContactMethod an associated entity, add 2 booleans to your Contact entity (PhoneContact and EmailContact) and create a microflow that is called when that reference selector for ContactMethod changes. In that microflow, if the ContactMethod is set to Phone, then set the PhoneContact boolean on the Contact entity to true, etc.

Which one works best for you depends on the business requirements you are working towards.

Hope that helps,

Mike

answered