2022.2

Table Of Contents
How to use the captured or selected image in a template
Afterauserhassubmittedtheformandthedatahasbeenextracted,youmaywanttodisplaythecap-
turedorselectedimageinaDesignertemplate,forexampleinaletteroronawebpage.Todothis:
1. Loadthedatamappingconfiguration(oratleastthedatamodel).
2. Insertadummyimageinthetemplate.
3. Right-clickthedummyimageandselectDynamic Image.TheTextScriptWizardappears.
4. UnderFieldselectthefieldthatcontainsthebase64-encodedstring.Thescriptputsthegiven
stringinthesource(src)attributeoftheimage(<img>).
InsteadofusingtheTextScriptWizard,youcouldalsowriteascriptyourself;see"Writingyourown
scripts"onpage808.
DateandFormattedDate
TheDateelementandtheFormattedDateelementdisplaythecurrentdateonthedevicewhenthe
formisfirstopened.Whentheelementistouched,adateselectorappearssotheusercanmodifythis
date.TheFormattedDateelementdisplaysdatesinaformatthatdependsonthelocaleofthedevice
onwhichtheuserisviewingtheform.ADateElementdisplaysdatesintheISO8601format:YYYY-
MM-DD.
Whentheformissubmitted,thedatedataissentasplaintext.AFormattedDateelementsubmitsthe
dateintwoformats:intheformatthatdependsonthedevice'sregionalandlanguagesettingsandin
theISOformatmentionedabove(usingahiddenfield).ADateelementsendsthedateintheISO
formatonly.
DeviceInfo
TheDeviceInfoElementaddsafieldthatcontainssomeinformationaboutthedevice(phoneortablet)
thatissubmittingtheCOTGForm.Thisincludesthedevice'stype(AndroidoriOS),operatingsystem
version,devicemodelanditsUUID(UniversallyUniqueIdentifier).Thisinformationcanbeusefulfor
bothtroubleshooting,iferrorsoccuronspecificdevicetypesforexample,aswellasforsecurityval-
idation:itispossibletomaintainalistofdeviceUUIDsthatareallowedaccess,topreventunauthorized
useevenifsomeonehasausernameandpasswordtoarepository.
DocumentID
TheDocumentIDelementretrievestheDocumentIDoftheformcurrentlyviewedbytheapp.You
couldputtheDocumentIDinahiddeninput,sothatwhentheformissubmitted,theDocumentIDis
submittedaswell.ADocumentIDcanbeusedontheserversidetocheck(intheConnectdatabase)if
thedatahasalreadybeensubmitted.
Page 636