Brian Dunning's FileMaker Custom Functions

JoinRepetitions ( repeatingField ; delimiter ; start ; nRepeats )

Returns all repetitions in the repeating field as combined string

  Average rating: 3.9 (34 votes) Log in to vote

Theo Ros   Theo Ros - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
JoinRepetitions ( repeatingField ; "|" ; 1 ; 4 )
  Sample output:
"Apple | Banana | Orange | Cherry"

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Returns all repetitions in the repeating field as string, combining the
repetitions with the given text in 'delimiter'

Paramers:
repeatingField - the repeating field you want combined
delimiter - the textfield or constant you want to use to combine the values
start - the starting repetition number. if < 1, the first repetition is assumed
nRepeats - the maximum number of repetitions you want joined

Return type: Text

Special thanks to Ari M. Weinstein who enhanced the function to prevent the delimiters from appearing when a repetition is empty.

 

Comments

Jim Dee   Jim Dee
Jun 10, 2020
Thank you for the great function. I didn't expect to have a delimiter at the end since the example shows "Apple | Banana | Orange | Cherry".

I get "Apple, Banana, Orange, Cherry, " when using ", " as a delimiter.
 
Jim Dee   Jim Dee
Jun 10, 2020
Thank you for the great function. I didn't expect to have a delimiter at the end since the example shows "Apple | Banana | Orange | Cherry".

I get "Apple, Banana, Orange, Cherry, " when using ", " as a delimiter.
 
Jim Dee   Jim Dee
Jun 10, 2020
Nevermind, I just realized that SortValues adds another return after sorting. The JoinRepetitions function works as expected.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: