I need a little help fixing (or understanding) a custom function meant to explode text. I'm using the result of this function as the foreign key in a portal filter. Alternatively, if someone has a working function to accomplish this that would be ideal .
It's two functions that I found on BrianDunning.com. The second one calls the first.
1. ExplodedKey ( Text )
Length ( Text ) > 1 ;
ExplodedKey ( Left ( Text ; Length ( Text ) - 1 ) ) & "¶" & Text ;
2. ExplodedString( StringFieldName)
[FieldName = Left ( StringFieldName & " "; Position ( StringFieldName ; " "; 1 ; 1 ) - 1 );
Counter = PatternCount ( StringFieldName ; " " )];
Counter = 0 ; "" ;
Counter > 30 ; "ERROR: too many fields" ;
ExplodedKey ( FieldName ) & "¶" &
ExplodedKey (Substitute ( StringFieldName & " " ; FieldName & " " ; "" )
Here is the result I'm getting for "Son of Batman" and I can't figure out why.
"Son of Batman" looks like this when it should explode every word indivually, so user could type in "Batman" and the portal would include this record.