Cheatography
                https://cheatography.com
            
        
        
    
                   
                            
    
                    GroovyScript to use when triggering Instant Notifications
                    
                 
                    
        
        
            
    
        
                                    This is a draft cheat sheet. It is a work in progress and is not finished yet.
                    
        
                
        
            
                                
            
                
                                                | Org Fields
                        
                                                                                    
                                                                                            | ${answers.fieldScriptName} |  Common Location Fields
                        
                                                                                    
                                                                                            | Location Name |  |  
                                                                                            |  | ${location.nameInSurvey}
 |  
                                                                                            | Location No. |  |  
                                                                                            |  | ${location.locationNumber}
 |  Common System Fields
                        
                                                                                    
                                                                                            | Cert Code | ${response._certCode}
 |  
                                                                                            | Exclusion Reason | ${response.exclusionReason}
 |  
                                                                                            | Loyalty Number | ${response.loyaltyNumber}
 |  
                                                                                            | Offer Code | ${response.offerCode}
 |  
                                                                                            | Redemption Code |  |  
                                                                                            | Response ID |  |  
                                                                                            | SQL ID |  |  
                                                                                            | UUID |  |  Customer Data Fields - Private
                        
                                                                                    
                                                                                            | First |  |  
                                                                                            | Last |  |  
                                                                                            | Email | ${answers._emailAddress}
 |  
                                                                                            | Phone | ${answers._phoneNumber}
 |  Customer Data Fields - Public
                        
                                                                                    
                                                                                            | First | ${answers._firstNamePublic} |  
                                                                                            | Last | ${answers._lastNamePublic} |  
                                                                                            | Email | ${answers._emailAddressPublic} |  
                                                                                            | Phone | ${answers._phoneNumberPublic} |  Additional Notification Options
                        
                                                                                    
                                                                                            | Link to Detail Window | ${_responseDetailLink_}
 |  
                                                                                            | Survey Date & Time | ${_responseDateTime_}
 |  
                                                                                            | Output ALL Detail Data |  |  |  | Date Fields
                        
                                                                                    
                                                                                            | Date of Survey | ${response.beginDate} |  
                                                                                            | Date of Service | ${response.dateOfService} |  Formatting Dates
                        
                                                            
                            | Date of Service  as mm/dd/yyyy  ${(response.dateOfService).format("dd-MM-yyyy")}
 |  
                            | Date of Service  as dd-mm-yyyy  ${new java.text.SimpleDateFormat('MM/dd/yyyy').format(response.dateOfService)}
 |   * For Date of Survey, substitute ".beginDate" Formatting Comments
                        
                                                            
                            | "No Answer" if 'Null' ${answers.ORG_FIELD != null ? answers. ORG_FIELD.getString() : "No Answer"}
 |  
                            | Nothing if 'Null' ${answers.ORG_FIELD != null ? answers. ORG_FIELD.getString() : ""}
 |  
                            | Show first 100 characters ${answers?.caseName?.getText() == null ? '' : answers.caseName.getText().length() > 100 ? answers.caseName.getText().substring(0,100) : answers.caseName.getText()}
 |  
                            | Display Translated Text ${answers.fieldScriptName.getTranslatedTextData() null ? answers.fieldScriptName.getTranslatedTextData().toString() : ""}
 |  
                            | Search for a Term ${(answers.groovyName !='' && ['word1','word2','word3'].indexOf(answers.groovyName.toString().trim()) > -1) ? "Found" : "Not found"}
 |  Formatting Boolean Groups
                        
                                                            
                            | Display selected Booleans from a Group |  ${answers. ORG_FIELD != null ? "OPTION 1 TEXT" : ""} ${answers. ORG_FIELD != null ? "OPTION 2 TEXT
 " : ""} ${answers. ORG_FIELD != null ? "OPTION 3 TEXT
 " : ""} ${answers. ORG_FIELD != null ? "OPTION 4 TEXT " : ""}
 |