Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Display A Comma-Separated List

Featured Replies

hi,

I have a dbase with a table of users. Each user has an email address.

How do I write a script to create a comma-separated list of just the email addresses of all of the users in the current found set? Ideally this should pop-up in a new window where the user could then just copy and paste it into whatever email application they needed.

Seems like this should be really easy, but it's been awhile since i've touched filemaker and it's been a long week...

Create a calc field My CalcField = EmailAddress & "; "

Create a global text field (MyGlobal) to hold combined Emails

Create a script:

Go to Record First

Clear [select; MyGlobal]

Loop

Set Field[MyGlobal; MyGlobal & MyCalcField]

Go To record Next; Exit after Last

End Loop

Copy [select; MyGlobal]

  • Author

Thanks.

I had set-up something like that. Unfortunately it seems to be extremely slow when dealing with more than about 1000 records.

Any way to speed this up?

Hi sbg2

You have a typo in your calculation field, you used the semicolon instead of the comma.

Also, you can accomplish this without a calculation field, you can do this by including that in your script.

Go to Record/Request/Page [ First ]

Clear [ MyGlobal ] [ Select ]

Loop

Set Field [ MyGlobal; MyGlobal & EmailAddress & ", " ]

Go to Record/Request/Page [ Next; Exit after last ]

End Loop

Copy [select; MyGlobal]

Not sure about the Copy Script Step, but I left it in.

Lee

cool.gif

Thanks.

I had set-up something like that. Unfortunately it seems to be extremely slow when dealing with more than about 1000 records.

Any way to speed this up?

* Exporting MyCalcField to a text file might work, if A) you were sure only 1 user would be doing this at a time : The email programs your users run handled return seperated lists well (MS Outlook seems to handle it well and uses semi-colons not commas as a seperator, it does handle commas as a seperator (changing them to semicolons once you leave the To: field) what you use will obviously depend on what best fits the email programs your users are using).

* Importing the found set into a related file and then using the ValueListItems function to set your MyGlobal field should be faster. You would need to set-up another global field that would hold a unique value for the find request so that the two tables would relate correctly (Random Number, UserName?). Again you would be dealing with a return seperated list.

* I have seen people say Find/Replace is much faster than looping but have not experimented with it much.

Are you freezing the window before performing the loop? That should help speed the process significantly, as might changing the layout to View as Form, if it is not currently in Form view.

Hi Jt,

Good suggestions.

Lee

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.