![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I am trying to find a way to pull information from a text field to a repeating field. What I have is a list of colors in a textfield. ie. red, royal blue, green, yellow, black What I am trying to do is make a repeat field that has one color ineach field. ie. red royal blue green yellow black Does anyone know of a simple way or complicated way to do this?Currently I am doing these lists by hand. Not fun. I have been able to create the list from the repeating field to thetext field but... the other way is beyond me. should I have several blank fields and then look for each word fromthe left? Is there a way to look for words between commas? Pleast let me know, Thank you Tim Each return-separated item in a list is a value. You can identify each |
#3
| |||
| |||
|
|
In article <1184612136.822056.92120 (AT) n2g2000hse (DOT) googlegroups.com>sales@kustom kaps.com wrote: Hello, I am trying to find a way to pull information from a text field to a repeating field. What I have is a list of colors in a textfield. ie. red, royal blue, green, yellow, black What I am trying to do is make a repeat field that has one color ineach field. ie. red royal blue green yellow black Does anyone know of a simple way or complicated way to do this?Currently I am doing these lists by hand. Not fun. I have been able to create the list from the repeating field to thetext field but... the other way is beyond me. should I have several blank fields and then look for each word fromthe left? Is there a way to look for words between commas? Pleast let me know, Thank you Tim Each return-separated item in a list is a value. You can identify each individually using the GetValue function: GetValue ( listOfValues ; valueNumber ) GetValue ( yourText ; 2 ) would be Royal Blue, GetValue ( yourText ; 4 ) would be Yellow, etc. Using a looped script, increment a script variable to identify both the valueNumber and which repition a Set Field step would put it in. Pseudo: Set variable $Value to 1 Loop Set Field RepField [ $Value ] to GetValue [ List ; $Value ] Set variable $Value to $Value + 1 If $Value > ValueCount ( List } exit script End if End Loop Matt |
#4
| |||
| |||
|
|
You don't need a script. Given: yourTextField (text) which contains a list of values separated by commas Create: myRepeatingValue (calculation, text result, repeating[n] values) = Substitute(Trim(MiddleValues( Substitute(Extend(yourTextField); ","; "¶"); Get(CalculationRepetitionNumber); 1)); "¶"; "") Using Trim() ensures things work smoothly whether the commas have a space following them or not. The outer Substitute() gets rid of the return FileMaker thinks is nice to include in MiddleWords results. "Matt WIlls" <Im (AT) Witz (DOT) End> wrote in message news:nemoMon071607031812 (AT) news (DOT) verizon.net... In article <1184612136.822056.92120 (AT) n2g2000hse (DOT) googlegroups.com>sales@kust om kaps.com wrote: Hello, I am trying to find a way to pull information from a text field to a repeating field. What I have is a list of colors in a textfield. ie. red, royal blue, green, yellow, black What I am trying to do is make a repeat field that has one color ineach field. ie. red royal blue green yellow black Does anyone know of a simple way or complicated way to do this?Currently I am doing these lists by hand. Not fun. I have been able to create the list from the repeating field to thetext field but... the other way is beyond me. should I have several blank fields and then look for each word fromthe left? Is there a way to look for words between commas? Pleast let me know, Thank you Tim Each return-separated item in a list is a value. You can identify each individually using the GetValue function: GetValue ( listOfValues ; valueNumber ) GetValue ( yourText ; 2 ) would be Royal Blue, GetValue ( yourText ; 4 ) would be Yellow, etc. Using a looped script, increment a script variable to identify both the valueNumber and which repition a Set Field step would put it in. Pseudo: Set variable $Value to 1 Loop Set Field RepField [ $Value ] to GetValue [ List ; $Value ] Set variable $Value to $Value + 1 If $Value > ValueCount ( List } exit script End if End Loop Matt |
#5
| |||
| |||
|
|
Nice. Playing with it, I find that it doesn't demand CSV; it worked on a return-separated list as well, which would be good in conjunction with the List function. I tried it as a Set Field step in a script, and all that came back was the first value, so there could be situations where a looping script might be necessary. Have you considered posting this as a CF at BrianDunning.com? There doesn't appear to be anything similar there yet. Matt In article <2tydndy2X6Y3PgHbnZ2dnUVZ_vGinZ2d (AT) comcast (DOT) com "BillMarriott" <wjm (AT) wjm (DOT) org> wrote: Given: yourTextField (text) which contains a list of values separated by commas Create: myRepeatingValue (calculation, text result, repeating[n] values) = Substitute(Trim(MiddleValues( Substitute(Extend(yourTextField); ","; "¶"); Get(CalculationRepetitionNumber); 1)); "¶"; "") |
#6
| |||
| |||
|
|
Thanks! The reason why it doesn't work in a script is the Set Field step is always hard coded to a repetition, the default being 1. (Big limitation!) And yes, any kind of delimiter will work, even spaces. |
#7
| |||
| |||
|
|
"Bill Marriott" <wjm (AT) wjm (DOT) org> schreef in bericht news:nP6dnW1-vNg0zQDbnZ2dnUVZ_oG3nZ2d (AT) comcast (DOT) com... Thanks! The reason why it doesn't work in a script is the Set Field step is always hard coded to a repetition, the default being 1. (Big limitation!) And yes, any kind of delimiter will work, even spaces. Bill, I don't know which version you have, but using SetField with version 8.5 Adv I can enter the repetition number as the result of a calculation (Which may hold any number of fields and/or variables). Which makes it not hard coded, but flexible. Keep Well, Ursus |
#8
| |||
| |||
|
|
What I mean by "hard coded" in this instance is that in the Set Field script step, it must be a particular repetition, and not the entire set of them. My formula relies on the Get(CalculationRepetitionNumber) function to populate the entire field at once without the need of a looping script. The calculation is "solid state" and always updates with a change to the source field. Scripts are much slower and prone to become out of sync if you're not careful. It's true that in earlier versions of FileMaker the repetition number was truly hard-coded; you couldn't specify it dynamically by a calculation (not sure when that feature was added). As for a workaround, one could possibly use Relookup to populate repeating fields within a script without the use of looping. |
![]() |
| Thread Tools | |
| Display Modes | |
| |