Custom Script to append an additional field onto the Subject

Custom Script to append an additional field onto the Subject

I am trying to create a custom script that a form rule can use. It needs to take the value entered into one field and append it to the subject line. All my attempts end up with null being entered. This suggests to me that I am using the wrong variable format to pull in the additional field. I have found lots of different options on other threads for what to name the variable, but nothing has worked.

Any help appreciated

  1. /*Set subject line from full user's supplied name*/
  2. var subtext="New User Account Request: ";
  3. var user=await CS.getValue("UDF_CHAR101");

  4. if(user !=null){

  5. var subject_text= subtext + user; 
  6. CS.setValue("subject",subject_text);
  7. }

  8. CS.end();

                  New to ADSelfService Plus?