Brian Dunning's FileMaker Custom Functions

mapJoin ( pre ; sep ; post ; str ; i ; values )

Combines multiple values into a single string

  Average rating: 2.5 (2 votes) Log in to vote

belg4mit   belg4mit - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
mapJoin("'"; ","; "'"; ""; 1; "foo¶bar¶qux")
  Sample output:
'foo','bar','qux'

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

This maps over a list of values, decorating them with pre and post text, joining the result with a separator. A sample use case is to take a collection of record IDs and combine them into a string for use in an ExecuteSQL IN clause such as:

ExecuteSQL("SELECT Fred FROM Barney WHERE Wilma IN("&mapJoin("'"; ","; "'"; ""; 1; $IDS)&")"; ""; "")

 

Comments

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 15 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: