Show Menu
Cheatography

Instant Notifications Cheat Sheet (DRAFT) by

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

${answ­ers.fi­eld­Scr­ipt­Name}

Common Location Fields

Location Name
${loca­tio­n.name}
 
${loca­tio­n.n­ame­InS­urvey}
Location No.
${loca­tio­n.id}
 
${loca­tio­n.l­oca­tio­nNu­mber}

Common System Fields

Cert Code
${resp­ons­e._­cer­tCode}
Exclusion Reason
${resp­ons­e.e­xcl­usi­onR­eason}
Loyalty Number
${resp­ons­e.l­oya­lty­Number}
Offer Code
${resp­ons­e.o­ffe­rCode}
Redemption Code
${rede­mpt­ion­Code}
Response ID
${resp­ons­e.id}
SQL ID
${resp­ons­e.s­qlid}
UUID
${resp­ons­e.uuid}

Customer Data Fields - Private

First
${answ­ers._f­irs­tName}
Last
${answ­ers._l­ast­Name}
Email
${answ­ers._e­mai­lAd­dress}
Phone
${answ­ers._p­hon­eNu­mber}

Customer Data Fields - Public

First
${answ­ers._f­irs­tNa­meP­ublic}
Last
${answ­ers._l­ast­Nam­ePu­blic}
Email
${answ­ers._e­mai­lAd­dre­ssP­ublic}
Phone
${answ­ers._p­hon­eNu­mbe­rPu­blic}

Additional Notifi­cation Options

Link to Detail Window
${_res­pon­seD­eta­ilL­ink_}
Survey Date & Time
${_res­pon­seD­ate­Time_}
Output ALL Detail Data
${_res­pon­seD­eta­ils_}
 

Date Fields

Date of Survey
${resp­ons­e.b­egi­nDate}
Date of Service
${resp­ons­e.d­ate­OfS­ervice}

Formatting Dates

Date of Service as mm/dd/yyyy
${(res­pon­se.d­at­eOf­Ser­vic­e).f­or­mat­("dd­-MM­-yy­yy")}
Date of Service as dd-mm-yyyy
${new java.t­ext.Si­mpl­eDa­teF­orm­at(­'MM­/dd­/yy­yy'­).f­orm­at(­res­pon­se.d­at­eOf­Ser­vice)}
* For Date of Survey, substitute ".be­gin­Dat­e"

Formatting Comments

"No Answer­" if 'Null'
${answ­ers.OR­G_FIELD != null ? answers. ORG_FI­ELD.ge­tSt­ring() : "No Answer­"}
Nothing if 'Null'
${answ­ers.OR­G_FIELD != null ? answers. ORG_FI­ELD.ge­tSt­ring() : "­"}
Show first 100 characters
${answ­ers­?.c­ase­Nam­e?.g­et­Text() == null ? '' : answer­s.c­ase­Nam­e.g­etT­ext­().l­en­gth() > 100 ? answer­s.c­ase­Nam­e.g­etT­ext­().s­ub­str­ing­(0,100) : answer­s.c­ase­Nam­e.g­etT­ext()}
Display Translated Text
${answ­ers.fi­eld­Scr­ipt­Nam­e.g­etT­ran­sla­ted­Tex­tData() null ? answer­s.f­iel­dSc­rip­tNa­me.g­et­Tra­nsl­ate­dTe­xtD­ata­().t­oS­tring() : "­"}
Search for a Term
${(ans­wer­s.g­roo­vyName !='' && ['word­1',­'wo­rd2­','­wor­d3'­].i­nde­xOf­(an­swe­rs.g­ro­ovy­Nam­e.t­oSt­rin­g().tr­im()) > -1) ? "­Fou­nd" : "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 " : "­"}