Moving data from one field to another

My scenerio:I have a field that is a text field that we inputted an employee’s name into as first name last name. Which is linked to a column in a view, which is now hidden. Now I’ve created to seperate text fields Last name, First name, and changed the original field to @Text(Firstname) + " " + @Text(Lastname), and created another column which allows me to sort by last name. I need to keep the original field for dblookups occuring from another database. I’d like to be able to populate the previous records that were entered into the original field into the two new fields to populate the new column. Is there a way to do this? Do I have to do some type of a string formula?

Thanks for you help!

Christine

Subject: moving data from one field to another

Use @Explode on the field to put the firstname and lastname into a list. Then use @Subset to get at the first element (firstname - second parameter 1) then again to get the second element (surname)

Cheers,

Adrian

Subject: RE: moving data from one field to another

Very Helpful!! I used…@If(“employee”!=“”);@Text(@Explode(@Right(employee;" "))). The new fields on the forms reflect the new data, but the view column is not reflecting the data in the fields…this is my column formula…@Text(Lastname) + ", " + @Text(Firstname)…shouldn’t this automatically reflect the changes in the view? It’s requring me to open each document into edit mode and saving, then the column refects the new info. Isn’t there a way to refresh the view without having to open each record into an edit mode?

Thanks again!

Christine

Subject: RE: moving data from one field to another

Your formula fragments don’t seem to be actually setting any values. I prefer @Word to @Explode so I’ll use it below

You need to do something like this:

FN := @Word(Employee;" "; 1);

LN := @Word(Employee;" "; 2);

FIELD NewFN := FN;

FIELD NewLN := LN;

This assumes you’re using a field named ‘NewFN’ to hold the first name and ‘NewLN’ to hold the last name and you have columns with NewFN and NewLN as the formulas.

This fails if you have more than a first and last name (John Van Der Gilder for instance) so you may need to handle that a different way.

HTH

Doug

Subject: RE: moving data from one field to another

Christine,

if you use @Right, then you don’t need to use @Explode. As you can see from Dan’s response, there’s often more than one way to tackle things, including @Word in this case.

If there is only ever one first name and one last name, then you can use @Left and @Right to get each part - and you don’t need to use @Explode (or @Text). Alternatively, if you use @Explode, then you can always get the first element (1 in second parameter of @Subset) and the last element (-1 in second parameter of @Subset) regardless of middle names - though you may want to include those, too (in which case you probably want to use @Right for the surname and @Left with this extracted surname to return everything else).

To update the fields, you presumably want to run an agent along the lines of Dan’s example. That should then sort out your view problem.

Cheers,

Adrian