Lookup on a list of values

Hey, so I have a list of โ€œPatient IDsโ€ which I get by subtracting two lists e.g (list 1 - list 2). Now the resulting list of โ€œPatient IDsโ€ from this expression contains IDs which I want to show in an enum list. Until here it is all fine and I am able to do this.

Now, instead of the patient IDs, I want to show the Patient Names in the Enum list because that will be more readable for the user. I am not able to find a way of doing this.

I was thinking of functionality like a Lookup function which can lookup an entire list of values and returns a list of values instead of just a single value (if that makes sense)

0 7 442
7 REPLIES 7

Hi Mate, thanks for such a quick reply. I like the approach you shared but actually even my Patient ID is not the Key Column, I have a different Key Column. Is there any way for that?

The only way to display one thing in a dropdown while storing something else is by using a key (a Ref value) to display its label.

Please describe your table structures a little more. This dropdown is to provide a value for a column of a row of what table? Is there a separate patients table?

Yeah Steve, I have two tables. One is โ€œPatients Sample Sentโ€ and another is โ€œSample Return from Chinaโ€. In โ€œPatients Sample Sentโ€ table I record the Patientโ€™s sample sent to China row by row. Then I have a โ€œReturn from Chinaโ€ table. Now, in โ€œReturn from Chinaโ€ table, I have a enumlist dropdown for selecting patient samples as multiple patients sample can be returned in single courier from China.

Also, a very important thing. I have created a third table โ€œPatients sample returnedโ€ for recording the patient samples row by row which have already returned from china The dropdown will only show the patient samples which have not yet returned. To achieve this I use list subtraction where I deduct Patient Sample Column of table โ€œPatient Sample Returnedโ€ from Patient Sample Column of table โ€œPatient Sample Sentโ€

Provided that multiple โ€œpatientsโ€™ sample sentโ€ can be contained in a single โ€œReturn from Chinaโ€, I would advise setting the โ€œSample sentโ€ table as a child of (search : ispartof appsheet) the โ€œReturnโ€ table.

Keeping things as enumlist can get things done too, but a parent-child relation offers far more flexibility.

From the โ€œSample sentโ€ table :

  1. You can add that sample to a new โ€œSample returnโ€ by an action. Make a column in the โ€˜sentโ€™ table thatโ€™s a yes/no column (sample marked for return?). An action will mark that column of the concerned โ€˜sample sentโ€™ record to yes.

  2. You can add a sample to an existing โ€œSample returnโ€, same way marking that column to yes.

  3. You can add sample sent records to sample return records from within the sample return table, by referencing the sample sent table (which would be set up already if you do the โ€˜ispartofโ€™) and devise a proper valid-if to filter all those records that doesnโ€™t have the โ€œsample marked for return?โ€ column as yes.

Also, since the sample sent rows that have been assigned a return shipment, will inherently contain the sample return reference, you can make use of isblank() and IN() to do away with the additional column.

  1. If you follow the above, you donโ€™t need a third table, which unnecessarily complicates things and adds to the sync time.

Given that you are subtracting lists, I might as well would assume you are advanced enough to understand what I said above.

Sorry friend but i am not that advanced user in App Sheet. Can you please refer me a resource where i can understand a little more about your approach. Or if you can just guide me a little more over how to set a child tble. I will try to do the rest myself

Top Labels in this Space