FileMaker 12 - Pick multiple items from a portal list

I have a list of patients, and I need to record their visits. On each visit, multiple diagnosis can be picked. So I have a list of diagnosis codes. I need to add multiple codes, and add them to the visit record on the portal.

So if the codes are: 443, 444, 445, 446, 447, 448, 449 (there are many) and I pick three, I need the portal list (visits) to reflect the number of selected items, separated by a comma.
LVL 19
MontoyaProcess Improvement MgrAsked:
Who is Participating?
Will LovingConnect With a Mentor PresidentCommented:
So, you have a script tied to the button that displays the list. At that point in the script, use Set Variable to clear any previous values in a variable I'll call $$CodesSelected by setting the value of the variable to "" or empty quotes. Follow that with a "Pause" script step.

To capture the selected values, set the Code button to do a Set Variable with the following calculation:

List( $$CodesSelected ; Code )

This will add the current code to any codes already selected to create a list.

Have a Continue button on the Code layout (at the top) set to do "Resume" script. This will un-pause the original script which should then Close Window and do a Set Field step, setting the Codes field in the Visit record to $$CodesSelected.

You'll still need the calculation field to display them with commas, but that should work.
Will LovingPresidentCommented:
Assuming you have a checkbox field listing the Diagnostic Codes, in order to display them as a comma separated list, you'll need to create a calculation field as follows:

CodeString =

Substitute( Codes ; "¶" ; ", " )

This takes the return-separated list of diagnostic codes (which is how checked items are saved beneath the checkbox exterior) and substitutes a comma and space for each carriage return.

In order to sort them numerically - if they were checked out of order - you'll need to use a Custom Function which requires FileMaker Pro Advanced to install.
MontoyaProcess Improvement MgrAuthor Commented:
Thanks for the reply.

Actually, my problem is that I cannot use a checkbox in my row. I have too many items. So I need a way to select those items in a popup or a different layout and take the accumulated values back to my portal listing.
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

MontoyaProcess Improvement MgrAuthor Commented:
I attached a screen shot. What I would like to do is click the button on the left, which would in turn select the record. All selected records would go in the header under (selected records), like 420, 510, 201:  Then I want to take that value and 'report' it back to my portal list record.

I hope that makes sense.
Will LovingPresidentCommented:
Do you just want to capture the Code when it's selected or are you creating a new record in a child table each time one is selected? (I'm assuming the former but need to check). What does your script look like now?

What you need is a script that opens a new window and goes to the Codes layout and pauses. Clicking each "Code" button would capture the Code Number and put it into either a Global Variable ($$) or a Global field for display in the header. When you return the Visit record  via a "Continue" (Resume script) button on the layout, the captured list of Code values is place into a Codes field in the Visit record using a Set Field[ ] script step.

Assuming you might want to bring up the list of checked Codes in the future with the descriptions, you'll mostly likely want to have a relationship from the Codes field on the Visit record and the table of Codes. And, you'll want that list to be carriage return separated so the relationship works. In order to display a return separated list of Codes with commas, you'll need a calculated display field as I described earlier.
MontoyaProcess Improvement MgrAuthor Commented:
Your description is pretty much on the money.

Ill try what you described, though I don't know how to do that. Thank you for the suggestions.

I have transactional data...

date  notes  codes   etc
date  notes  codes   etc.

So, I made the code in the portal a button. When you click in it, it displays the code layout, which is the list I showed in my picture.

Again, Ill try your suggestions. Thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.