AndreaJohannes
6 years agoQrew Trainee
Adding a conditional item to a list of missing items
Howdy,
I currently have a formula text field called "missing documents". It looks at various fields to see if there is a date in the field. If there isn't a date in the field, then it gets added to the list. Currently, all of the documents in this list are required. I want to add a Student Driving Record document to the list - but this is only needed if yes is chosen in the StudentDriving field . I'm not quite sure how to change the definition of the output text to say if [StudentDriving] = "yes" AND the Student Driving Record Received is null, then Student Driving Record. Once I get that piece, I'm pretty sure I can figure out the rest of it. Below is the current code in the field. If I can figure out the optional piece of defining the output, I think I can figure out the rest of it. Thanks in advance for your help!
//First define the output text if an item is missing
var text Application=If(IsNull([Application Received]),"Application","");
var text SignedPD=If(IsNull([Signed Position Description Received]),"Signed Position Description","");
var text Training=If(IsNull(),"Training Acknowledgement","");
var text DualEmployment=If(IsNull([Dual Employment Acknowledgement Received]),"Dual Employment Acknowledgement","");
var text NewSTudentOrientation=If(IsNull([New Student Orientation Certificate Received]),"New Student Orientation Certificate","");
//Next Define if there are missing items
var bool missingItems=$Application <>"" or $SignedPD<>"" or $Training <>"" or $DualEmployment <>"" or $NewStudentOrientation <>"";
//Define an optional text value to describe what the items are that will list
var text prefix=If($missingItems=true,"Missing Items:","");
//Next list all the "missing" items in a simple-list formul
List("\n",
$Application,
$SignedPD,
$Training,
$DualEmployment,
$NewStudentOrientation
)
------------------------------
Andrea Johannes
Associate Director Business Services
Residence Life
Texas A&M University
------------------------------
I currently have a formula text field called "missing documents". It looks at various fields to see if there is a date in the field. If there isn't a date in the field, then it gets added to the list. Currently, all of the documents in this list are required. I want to add a Student Driving Record document to the list - but this is only needed if yes is chosen in the StudentDriving field . I'm not quite sure how to change the definition of the output text to say if [StudentDriving] = "yes" AND the Student Driving Record Received is null, then Student Driving Record. Once I get that piece, I'm pretty sure I can figure out the rest of it. Below is the current code in the field. If I can figure out the optional piece of defining the output, I think I can figure out the rest of it. Thanks in advance for your help!
//First define the output text if an item is missing
var text Application=If(IsNull([Application Received]),"Application","");
var text SignedPD=If(IsNull([Signed Position Description Received]),"Signed Position Description","");
var text Training=If(IsNull(),"Training Acknowledgement","");
var text DualEmployment=If(IsNull([Dual Employment Acknowledgement Received]),"Dual Employment Acknowledgement","");
var text NewSTudentOrientation=If(IsNull([New Student Orientation Certificate Received]),"New Student Orientation Certificate","");
//Next Define if there are missing items
var bool missingItems=$Application <>"" or $SignedPD<>"" or $Training <>"" or $DualEmployment <>"" or $NewStudentOrientation <>"";
//Define an optional text value to describe what the items are that will list
var text prefix=If($missingItems=true,"Missing Items:","");
//Next list all the "missing" items in a simple-list formul
List("\n",
$Application,
$SignedPD,
$Training,
$DualEmployment,
$NewStudentOrientation
)
------------------------------
Andrea Johannes
Associate Director Business Services
Residence Life
Texas A&M University
------------------------------