Hi All, Is it possible to make an EnumValue u...

(Malaka Jayawardene) #1

Hi All, Is it possible to make an EnumValue unselectable if the same column is encountered via a different row for the same individual?

For example, In the table “Management”, I have an Enum type column called “Management Option” which has 3 Enum values in it. 1) Surgical 2) Non-surgical 3) Pending MDT Decision

Since the “Management” table is a child table for the parent table “Personal Details”, the user can create any number of management option rows for the same initial patient. Let’s say a patient is being managed non-surgically initially. So the user selects Non-surgical as the Enum value from the drop-down menu and proceeds to fill the details pertaining to it. Now if the patient’s management has changed, and the patient is undergoing surgery, the user can create a new management row and select “surgical” from the Enum values and proceed to fill the details pertaining to that. That is exactly what I want, but when the user enters the ‘management’ table again to select ‘surgical’, I would prefer if the ‘non-surgical’ option is not selectable for the user (like it’s inactivated or not visible), so that the user can’t create another row for ‘non-surgical’, but can only select either ‘surgical’ or ‘pending MDT decision’. Is this something doable within AppSheet?

(Reza Raoofi) #2

Yes, it is possible, you could use a conditional expression in the Enum column’s Valid_if to check see if “surgical” value already exists in the child Management table for that particular Personal Details’ row ID, and in that case return a shorter list which excludes “non-surgical”; something along the lines of:

IF(IN(“surgical”,SELECT(…)), LIST(“Pending MDT Decision”, “surgical”), LIST(“Pending MDT Decision”, “Non-surgical”, “Surgical”) )

I will leave the SELECT(…) part to you.

(Malaka Jayawardene) #3

@RezaRaoofi Thank you for the reply. I’ll try this!