I don't see any use of the List() function anywhere in your script. You have a variable named $surveyList, but you aren't using the list function to put a list of values into this variable, just the value of survery_identifier for the current record.
Even if you were to use List such as this step: Set Variable [$SurveyList ; Value: List ( Assessments::survey_identifier) ]
You'd still get just the value or values from the current record.
In order for List to return a list of values from a group of records, you have to refer to the records via a relationship--which you can't do with the approach you are using in your script.
Using your scripted find to pull up the selected records, you'd need one of the following sets of scripts inserted after the Perform Find[Restore] step:
Go To Record [First]
Set Variable [$SurveyList; value: List ( $SurveyList ; assessments::survey_identifier )]
Go To Record [next ; exit after last ]
Go To Layout [//specify a layout based on assessments, but with only assessments::survery_identifier present on this layout]
Copy all Records
Go To layout [//specify a layout where a field for holding your list of values is present on the layout]
Paste [//specify the field where you want your list of values]
The List Function will return a list of all the e-mail addresses in the related records.
If you can determine the set of records you want by relation then the list function will return exactly the list you want.
Alternatively, you can generate the equivalent in a $Variable from any found set by setting a script to loop down the list and set the collecting variable to be:
Go to record [first]
$EmailAddressesList = ""
$EmailAddressesList = $EmailAddressesList & "¶" & EmailAddress
Go to Record [Next; Exit after last]
Awesome! Thanks for the recommendations. I figured it would likely take some sort of loop, but someone recommended using the List() funciton, so I attempted that route. I'll try one of these and let you know the outcome. I foresee a lot of posts coming from me onto these forums. Hopefully, I'll be able to return the favor one day.
Thanks again...got it working perfectly! Just added a simple loop.