I have a string in a computed text field on form.The string contains a history of due dates changed in the field direcly above it on the form, who changed the date and when.
Example data in field:
07/23/2004 - Joe Smith - 07/15/2004 1:18:07 PM
07/09/2004 - John Doe - 05/28/2004 11:55:17 AM
06/10/2004 - Mary Jones - 11/12/2003 9:10:44 AM
What I need to do is pull out the first date only and put this in another field so that the field would contain:
07/23/2004
07/09/2004
06/10/2004
in an array format.
An suggestions? Oh, and the first field is one big long string, not a multivalue field.
Thanks
Subject: Tricky string to search
Create a text list from the string using @Explode. Try to find out what is the character or substring that seperates each history item. Use @Left from the text list to get the date.Optionally you can use @Implode to make it one big long string again.
Try to focus on the @Explode function to find your answer.
Subject: RE: Tricky string to search
Thanks I shall try the @Explode and all of its variations…Sometimes you just need a starting point…
Subject: Tricky string to search; Success!
Here is the resulting formula that got my desired results:
FIELD list:=@Explode(fieldName);
temp := “”;
@For(n := 1; n <= @Elements(list); n := n + 1;
@If(@Contains(list[n];“/”); temp := list[n]:temp; temp));
final := “”;
@For(m := 1; m <= @Elements(temp); m:= m + 1;
@If(@Modulo(m;2)=0; final := temp[m]:final; final));
final
It displays every other data in the original field.
Subject: Easier way
@Left(@Explode(yourfield; @Newline); " ")
Besides being inefficient, your formula creates an field named “list” which I’m assuming you don’t need or want in your document. Don’t use the FIELD keyword for a temporary variable.