14 Replies Latest reply on Sep 6, 2016 6:04 PM by David Moyer

# List in Calculation

Hi Filemaker Friends,

I'm using "List ( field {; field...} )" for the first time in a calculation.  I noticed that it doesn't show repetitions in my list.  Is there a way to show the repetitions?

If 5 records had the text: green, blue, green, yellow, orange, my resulting list would read:

green

blue

yellow

orange

Any suggestions would be super helpful.  If I'm able to figure this one out, I could potentially save a ton of time on grant applications.

Thanks everyone!

• ###### 1. Re: List in Calculation

What do you mean by repetitions? In FM the term "repetition" has a specific meaning because fields and variables can have repetitions.

• ###### 2. Re: List in Calculation

HI,

the question is a bit confusing (to me).  Given,

List("red"; "green"; "red"; "green")

... do you want to see

red

green

... or ...

red

green

red

green

?

thanks

• ###### 3. Re: List in Calculation

List only works across a relationship.

If you have TableA and have a calculated field with List (TableA::the_field) it only duplicates the content of TableA::the_field.

If you have TableA and TableB and have a calculated field in TableA with List (TableB::the_field) it produces a return delimited list of all the values if any across the relationship between TableA and TableB

• ###### 4. Re: List in Calculation

I'm a bit confused because List(); on the contrary, does NOT deduplicates.

If the related set is a, b, b, a, c, so will be the result of List function.

If you want to sort and dedupe, you can create a value list.

1 of 1 people found this helpful
• ###### 5. Re: List in Calculation

For that you need to use the Extend() function for repeated fields

• ###### 6. Re: List in Calculation

List only works across a relationship.

Not necessarily.

List ( "Value 1" ; "Value 2" ; "Value 3" ) returns:

Value 1

Value 2

Value 3

List ( table::repeatingfield ) will return values in all repetitions of the repeating field

List ( relatedtable::repeatingField ) will return all repetitions of the repeating field in all related records

The OP hasn't given much information to go on but I suspect (as you address) that s/he is expecting the List ( ) function to gather a list of all values in the field from all records but hasn't established a relationship to do so.

1 of 1 people found this helpful
• ###### 7. Re: List in Calculation

On the other hand, the "list of" summary field can generate the same type of list from all records in the current found set.

1 of 1 people found this helpful
• ###### 8. Re: List in Calculation

I'm still wondering if RPeters  wants duplicates, or no duplicates.

• ###### 9. Re: List in Calculation

Hi Everyone!

My apologies for the late response!  Thanks for all the replies.  Maybe my terminology was incorrect - sorry about that.  When I created the list, I do want to see duplicates.

If there were 3 related records and the field I was pulling from was "green" for all three records, the resulting list was:

green

I would like to see:

green

green

green

Does that make sense?? I'm sorry if my way of explaining things isn't quite accurate.

Thanks again for all your help!!

• ###### 10. Re: List in Calculation

RELATED Records are called like this:

List(otherTable::myField) then you get all values from the related records for that field.

• ###### 11. Re: List in Calculation

all non-empty values, if that matters. If you're also trying to capture related records without assigned colours then you'll have to find another method, possibly using ExecuteSQL( ).

• ###### 12. Re: List in Calculation

you are correct. NON-blank values are returned from List() function

• ###### 13. Re: List in Calculation

othertable:: is the important thing, RPeters , you may be miss-selecting the table or "context" of calculation.

1 of 1 people found this helpful
• ###### 14. Re: List in Calculation

to add to the "wrong context" thread, if the TO you're using is based on, say, a "Colors" table, as opposed to a table based on, say, Products with an attribute of Color, then the "List" will not show repetitions as you intend - just the unique colors in the Colors table.