Brian Dunning's FileMaker Custom Functions

Explode ( separator ; text ; limit )

Split a string by a string - inspired by similar text parsing functions

  Average rating: 4.0 (1 vote) Log in to vote

Chris Irvine   Chris Irvine - Show more from this author
Threeprong.com LLC
https://threeprong.com

Share on Facebook Share on Twitter

  Sample input:
Explode ( ":" ; "uno:dos:tres:cuatro" ; "" )
  Sample output:
uno
dos
tres
cuatro

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

Inspired by the capability of the famous PHP function by the same name.

This is useful if you need to process a string which is delimited by comas, pipes, tab, or any other character. Quickly pivot that string into a value list which is then easy to access with the GetValue family of built-in functions.

The optional limit argument can enhance behavior and shave off unnecessary work. Further examples can be found in script comments.

 

Comments

Vinny giardina   Vinny giardina
Jul 22, 2022
Does this only work if the field calculation is unstored?
 
Chris Irvine   Chris Irvine, Threeprong.com LLC
Aug 29, 2022
The function works with our without fields, stored calculations or not. Your specific situation would dictate which would preferred.

There is no evaluate() in there. References that force an given calculation to be unstored should be the same as with built-in text processing functions.
 

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: