When data is entered into a form, how to initiate a lookup field with the value of a field in the same form?

When data is entered into a form, how to initiate a lookup field with the value of a field in the same form?

I have a form that looks up (points to) values in second form, and upon initiation of a new record I want to use the value of another field to intiate the selection on the lookup field.  However, while I can do it using scripts in other parts of the application--for example on submit for a third form--I can't seem to do it within the on add process for the record itself.
 
I've tried the following formats, marked in red, both in On validate and On success actions:
 
for each x in <formname> [ ]
{
insert into ...
[
       <select field> = input.initialValue
or   x. <select field> = input.initialValue
 
]
or below the insert:
   x.<select field> = input.initialValue;
}
 
It runs without errors reported, but the value for the lookup item remains blank.
 
Suggestions?
 
ps: I have a workaround, but it takes several minutes to compute.