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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
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.
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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
Will LovingPresidentCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FileMaker Pro

From novice to tech pro — start learning today.