I'm trying to complete the first business process step in a new series of applications for a small non-profit organization. We receive referrals from social workers and healthcare workers recommending that we provide services to one of their clients. The Referral is in the form of an email with a large number of questions and responses.The questions are fixed as to both wording and sequence so we do not have to parse them.. The responses are interspersed between the questions.
I have written a parser script to extract the answers and that works. It is a loop that finds on response (the next response) as a text string. We already know the question simply by question number which is also the index variable within the loop. By the time we get to the end of the parsing loop, I have the values for the following two script variables for the next response:
- $Current_Response_Field_Name Value: Client_Home_Phone
- $Current_Response_Text Value: 2104144937
The problem is that I now need to store the value in the variable $Current_Response_Text into a field in a Table TO1:Referrals. The name of the target field varies with each pass through the loop and it is contained in the script variable $Current_Response_Field_Name. In this example, the name of the field is Client_Home_Phone.
I have not been successful in storing the value into the field. The problem seems to be the indirect naming of the field in a script variable. I've tried various combinations of Set Field and Set Field by Name along with various ways of passing the field name to that script step. The result is always Error 102, Field is Missing.
Can anyone show me how to write a script step that accomplishes the above objective?