Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6691 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a table with contact information for customers

And i have a table for open service tickets.

The fields are related by company.

I have a button to send an email internally to announce the new ticket.

I want the ticket to include the email addresses of all related contacts (related by company)

Now I could use

Count ( Contacts::EmailAddress)

for an If statement, to determine if there are more than one contact records for that customer

And i could use GetNthRecord ( Contacts::EmailAddress; 2)

But what i want to know, is there any way to do a For Loop?

Like

For( TempVar; Start at 1; end at Count ( Contacts::EmailAddress);

GetNthRecord ( Contacts::EmailAddress; TempVar)

)

I know there is no for loop, but how can i do a conditional loop that doesn't force me to copy the same code over and over and change the numbers for each repetition

It just seems so inefficient to me.

Thanks in advance!

Posted

It would be really easy to do with the List function if you had FileMaker 8.5:

List(Contacts::EmailAddress)

If you want to use GetNthRecord, you'll need FileMaker Advanced to create a recursive custom function.

GatherRecords (Field; Found) =

Case(

Found > 1;

GetNthRecord(Field; Found) & "¶" & GatherRecords(Field; Found - 1);

GetNthRecord(Field; 1)

)

Once you have the recursive custom function, you can call it in a calculation using the following:

GatherRecords (Contacts::EmailAddress; Count(Contacts::EmailAddress))

Posted (edited)

1. Same as here.

2. You can also define a value list of e-mail addresses (only related values) and use ValueListItems() to get the values.

Edited by Guest

This topic is 6691 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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