Jump 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.

Calc to contain all "Emails" from a portal

Featured Replies

Using a portal, each row has a field with an email address. I need to have a calc field that will grab all the emails from the portal on the page and list them with a line break between each one. Tried this a number of ways with no luck. Anyone done one like this before?

LR

Don't use a portal. Do it with a list view in the related file. You can use a Go to Related Record (show) to isolate the set of records you need. Create a list view just for this purpose. Put the email address field on it and NOTHING ELSE, no labels, no other fields, no graphics, nada. When you execute a Copy All script step on this layout in Browse Mode, followed by a paste to a text field on another layout, you will get a carriage return separated list of email addresses.

-bd

Another option is to use the ValueListItems() function. Just define a valuelist based on the same relationship that the portal is based on. The ValueListItems() function will then return the related items separated by carriage returns.

  • Author

I kind of have to do it as a function. The related portal is a self relationship within the same database. I need the calc field on each record to look at the portal and list all the emails from the portal for that record. This calc result will then be used by another database file.

So let me see if I understand this...

My portal relationship is names "tasks." The field in the portal in question is named "email."

So I create a value list, selecting "Use values from field" and choose tasks::email.

Create my calculation using ValueListItems (dbname, valuelist).

I dont quite understand how this calc works. If I try to replace dbname with the name of my database, I just get an error "This field cannot be found."

I assume I replace valuelist with the name of my newly created value list?

LR

  • Author

OK< Found my own answer.

ValueListItems("Contac.fp5", "Email")

have not used this function before, so the "" marks threw me. Used to using them for quoting text in a calculation.

Thanks for the solution...worked like a charm and did EXACTLY what I needed.

LR

No problem... there are a few caveats with this solution, however. Often it doesn't automatically refresh. Bob Weaver suggests this modification:

Valuelistitems("MyFile","ValLst") & Left("",Count(MyRel::AnyField))

And I like to take it one step further by replacing "My File" (the name of the file) with Status(CurrentFileName). This way, if you change the name of the file using Developer Tool or what-have-you, you don't have to worry about altering the calc.

  • Author

With the addition suggested above, what exactly does the Count(MyRel::AnyField) portion do?

Do I replace the MyRel::AnyField with the same information that is in my value list? For example:

My value list looks like this:

Similar:Email Combined

So would the calc look like this:

Valuelistitems("Contact.fp5","Email") & Left("",Count(Similar::Email Combined))

LR

  • Author

OK, now I see what you say by "Often it doesn't automatically refresh." So I include the new code:

Valuelistitems("Contact.fp5","Email") & Left("",Count(Similar::Email Combined))

But now the problem is that by adding this I can no longer turn indexing on.

LR

Create an account or sign in to comment

Important Information

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

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.