Brian Dunning's FileMaker Custom Functions

ExtractListSegment ( list ; divider ; SegmentNum )

Use when you have a list that contains multiple values per list item and you only want a single value.

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

Paul   Paul - Show more from this author
Peak 14 LLC
http://www.peak14.solutions

Share on Facebook Share on Twitter

  Sample input:
ExtractListSegment ( List ( "1, A" ; "2, B" ; "3, C" ) ; ", " ; 2 )
  Sample output:
A ¶ B ¶ C

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

Very helpful for when you are getting multiple fields via SQL and want to extract all the values for a single field.

 

Comments

Fabio Montaldi   Fabio Montaldi
Jul 6, 2020
Hi Paul and thank you for sharing the ExtractListSegment function.
I'm trying to implement it in my project, but it gives me an error:
"The Specified Parameter Could Not Be Found" for (theList):
"~ count = ValueCount (theList);"
Can you help me?
Besides, I have the Italian version ....
Bye bye
Fabio
 
Fabio Montaldi   Fabio Montaldi
Jul 6, 2020
Sorry, I was wrong, I didn't put the function parameters ......
Now accept me, the function, but it doesn't give me the result in the field ...
I can't understand how to enter data when I use the function .... the example is not very clear .....
Hi and thanks again
 
Paul   Paul, Peak 14 LLC
Jul 6, 2020
Hi Fabio, can you provide what you are trying to do with this? The more details the better.

Most likely you will want to use this in a script. If you set the list to a variable and set a new variable using this function, then you can use it wherever you want. It might look something like this:

Set Variable [ $myList ; myTable::ListField ]
Set Variable [ $extractedList ; ExtractListSegment ( $myList ; "|" ; 2 )
Set Field [ myTable::ExtractedList ; $extractedList ]
 
Paul   Paul, Peak 14 LLC
Jul 6, 2020
Also, just to make sure, do you have FileMaker 18 or above? It uses the new keyword "While" that can only be used in versions 18 or above.
 
Fabio Montaldi   Fabio Montaldi
Jul 6, 2020
Hi Paul and thanks for the reply .....
I have Filemaker 18 Adv and Windows 10 ...
I'll explain what I'm doing .....
In practice on the monitor I have 65 text fields with pop-up menus to choose
from a list a value between fifteen, and daily, then monthly,
I have to make a report of the choices made .... so I thought of doing
a check with the list of starting values and various fields.
These 65 fields are all in a record, which is updated daily, such as planning .......
Sorry if I went on, but at least I explained to you what I would need.
Greetings and thank you very much.
 
Fabio Montaldi   Fabio Montaldi
Jul 6, 2020
Hi Paul and thanks for the reply .....
I have Filemaker 18 Adv and Windows 10 ...
I'll explain what I'm doing .....
In practice on the monitor I have 65 text fields with pop-up menus to choose
from a list a value between fifteen, and daily, then monthly,
I have to make a report of the choices made .... so I thought of doing
a check with the list of starting values and various fields.
These 65 fields are all in a record, which is updated daily, such as planning .......
Sorry if I went on, but at least I explained to you what I would need.
Greetings and thank you very much.
 
Fabio Montaldi   Fabio Montaldi
Jul 6, 2020
Hi Paul and thanks for the reply .....
I have Filemaker 18 Adv and Windows 10 ...
I'll explain what I'm doing .....
In practice on the monitor I have 65 text fields with pop-up menus to choose
from a list a value between fifteen, and daily, then monthly,
I have to make a report of the choices made .... so I thought of doing
a check with the list of starting values and various fields.
These 65 fields are all in a record, which is updated daily, such as planning .......
Sorry if I went on, but at least I explained to you what I would need.
Greetings and thank you very much.
 
Fabio Montaldi   Fabio Montaldi
Jul 6, 2020
I don't know why, but he entered the comment three times .......🤔🤔🤔
 
Paul   Paul, Peak 14 LLC
Jul 7, 2020
Hey Fabio, I'm not sure if this function will apply to what you're doing. Are you saying that you have 65 different fields and you are trying to get the data from those fields?
 
Fabio Montaldi   Fabio Montaldi
Jul 7, 2020
☹️☹️....unfortunately yes......
 

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: