Doesn't Enum List work with ShowIf expression...

(Malaka Jayawardene) #1

Doesn’t Enum List work with ShowIf expression? For example, if there’s a list of items in the Enum List and user selects 2 out of it, can’t the ShowIf expression work for subsequent text fields to appear based on the items selected from the Enum List?

(Suvrutt Gurjar) #2

I believe generally it is possible. Could you please add what challenge you are facing?

You may also wish to also add what kind of show_if condition you wish to have for subsequent fields? Such as based on maximum of

any two values in the enumlist or based on two specific values or based on at least any two

values being selected etc.?

(Malaka Jayawardene) #3

@Suvrutt_Gurjar Thank you so much! It worked like a charm!

And for the detail view blanks, if we go to UX>Options and make “Apply show-if constraints universally” switched off, when the user doesn’t fill any field, the detail view will stop showing the headers. :slight_smile:

By the way, do you know if we could change the position of a virtual column when viewed in Form View? In the detail view, we can change its position, but I was wondering if it’s possible to do that in the Form View too, because all virtual columns appear at the bottom of a Form View.

(Suvrutt Gurjar) #4

Hi @Malaka_Jayawardene Good to know you have got the enumlist based show_if and dependent columns working.

As for changing the order of virtual columns as desired in the form view, did you try creating a slice on the same table and setting the desired column order in the slice and then using that slice in subsequent views as input?

(Malaka Jayawardene) #5

@Suvrutt_Gurjar Thank you for that. I created a slice like you’ve said. But I couldn’t get that sliced form to open up in the app. I’m trying to create a database for hepatopancreaticobiliary patients in my clinic. So the form that collects data initially has a “personal details section”. At the end of it, there are multiple sections shown as “ref views” referenced to several tables in the same spreadsheet as I want different aspects of the data to be collected in different tables. So there’s a “clinical details” table, a “blood investigations” table, an “imaging and biopsy” table and so on and so forth referenced to the main table (personal details section) by a key which is the patient’s unique ID, so when I want to add details of a patient, these different tables can be accessed after inputting the personal details (see image). What I’m trying to do now is change the order of the columns in the “imaging and biopsy” form when it is opened up, because all the virtual columns in “imaging and biopsy” form appear at the end. I managed to create a slice of the form according to the way I want, but I’m unable to get it opened up when I go and tap the “imaging and biopsy” section in my main form. Any idea to tackle this? Appreciate your input.

(Suvrutt Gurjar) #6

Hi @Malaka_Jayawardene could you please add if you are facing challenge

in opening the form only with one referenced table " imaging and biopsy "? If so,

could you please add what error / behavior you are getting when tapping it? Is the order of columns in referenced tables’ subform not in desired order?

Are other fields

of the main form in the order as you desire after use of slice?

(Malaka Jayawardene) #7

@Suvrutt_Gurjar In that Image I’ve shared, you can see “Clinical Details”, “Blood Investigations”, “Imaging & Biopsy”. These are referenced tables that open up when “New” button is tapped. The parent table is the one that records the “personal details” of the patient like name, age, contact number, address, marital status, referring unit etc. (you can see the “referring unit” column immediately above the Clinical Details section. That “referring unit” column is the last column of the parent table:“Personal details”), and at the end of the parent table, the referenced child tables are displayed as Clinical details, Blood investigations, Imaging & Biopsy, MDT decisions, Diagnosis, Management, Histology, Follow up (you can only see the 1st three in that image). When tapped each one, the relevant subform opens. My issue is, when I go to Imaging & Biopsy, I have added a few virtual columns inside that need changing of their order. I want a virtual column to appear after a physical column in the table, and then a physical column to appear after that virtual column and so on and so forth, but I can’t seem to get it done. If I am to tell you the exact issue, in the imaging & biopsy section, there are multiple choices of imaging techniques to select and I used the EnumList formula you gave me to get the dependent columns working. Let’s say I select USS and CT Scan from the options list, so dependent columns pertaining to both USS and CT scan would open up. USS’s dependent columns are USS Date, USS Summary and USS Image upload, and CT’s dependent columns are CT Date, CT Summary and CT Image upload. As AppSheet allows only a single image to be uploaded per a single entry, and since I want to upload multiple CT/USS images for a single patient, again I had to resort to reference tables here and therefore I created separate tables for USS image upload and CT image upload, and now the parent table is the “imaging & biopsy”, and the child tables are USS image upload and CT image upload tables, and since these appear as virtual columns, they appear at the end of the imaging & biopsy form, I wish to get the USS image upload virtual column after USS date and USS summary columns, and then CT image upload virtual column after the CT date and CT summary columns. I can’t get it to work however because slicing doesn’t work to get the subforms (child tables) opened up on AppSheet as far as I could figure. Was wondering whether there’s a way to circumvent this issue. Thanks.

(Suvrutt Gurjar) #8

Hi @Malaka_Jayawardene Thank you for your detailed note.

Does following expression help?

CONTAINS([Enumlist Column Name],“Enumlist Option Name”)

in show_if of respective Enumlist option

dependent columns (Date,Summary and Image) and so on for each enumlist option names: CT Scan, USS ,MRI/MRCP etc.

You may make these three (date.summary

and image) columns for respective enum list options as “Required”.

If dependent columns are kept optional, I believe their headers will appear in detail view, even when data entry is left blank by the user.

(Malaka Jayawardene) #9

Thanks for the reply Suvrutt. My requirement is like this. An Enum List has the following options to select. Ultrasound scan (USS), CT scan, MRI/MRCP, ERCP, EUS, PET, Image guided biopsy. If the user selects one or may be a few of these options, I want what is relevant to each of these investigations to appear for the user to fill in. For example if user selects Ultrasound scan (USS), I want the data fields related to USS to appear which are Date of USS (a date column), Summary of USS (a long text column) and Image upload button (an image column) for USS to appear. If user selects CT scan, I want Date of CT scan, Summary of CT scan and Image upload button for CT scan to appear so that user can fill up those. So on and so forth. If user selects USS and CT scan both, I want all those 6 fields to appear. If user selects USS, CT, MRI/MRCP, I want all the fields of those 3 options to appear. If user selects all of the options from the list I want all all the fields for each of those to appear. I hope you got what I meant.