2022.2

Table Of Contents
Itisrecommendedtocheckatleastoneoftheoptions:asyncordefer,orboth.Pagecontentwill
becomevisiblemorequickly,resultinginabetteruserexperience.
Ifyouenablebothoptions,asynctakesprecedenceonmodernbrowsers,whileolderbrowsersthat
supportdeferbutnotasyncwillfallbacktodefer.
Whenneitheroftheoptionsischecked,thescriptgetsfetchedandexecutedimmediately,interrupting
thepageloadingandrendering.
JSONsampledatadialog
TheJSONsampledatadialogletsyouloadJSONdataintotheDataModel(see"Loadingdata"on
page299).
Bydefault,theJSONdataismappedtocorrespondingfieldsintheexistingDataModel.Datathatdoes
notcorrespondtoanyfieldisdiscarded.
YoumayusetheReplaceDataModeloptiontolettheJSONdatareplacetheexistingDataModel.
Thedialogisopenedviathemenu:File > Add data > JSON sample data,orviatheJSONSample
DatatoolbarbuttonontheDataModelpane.
Theoptionsinthisdialogare:
l
File:ThepathandnameoftheJSONfiletouse.ThefileisassumedtobeUTF-8encoded.
l
Browse:OpensanexplorerwindowtobrowsefoldersandselectaJSONfile.
l
TheboxbelowthefilenameallowstopasteorenterJSONdata.AfteropeningaJSONfilethe
JSONdatawillappearinthisbox.YoucanreviewandedittheJSON.
l
Replace Data Model:SelectingtheReplaceDataModeloptionremovestheexistingData
ModelfromthetemplateandcreatesanewDataModelbasedonthekeysfoundintheJSON.
Whenthisoptionisnotchecked,theJSONdataismappedtoanycorrespondingfieldsinthe
existingDataModel,anddatathatdoesnotcorrespondtoanyfieldisdiscarded.
l
Finish:IftheJSONisvalid,youmayclickFinishtoimportthedataintotheDataModelpane.
Arraysofobjectsareconvertedtorecords;key-valuepairsareconvertedtodatafields.Ifavalue
inarecordobjectisaJSONobject,itisignored.
Note: TheJSONSampleDataisnotstoredwiththetemplate.Inordertoreusethedatayou
shouldcreateaJSONfileondiskandloaditviatheFileoptioninthisdialog.
Types of JSON data
Examples
Example: Asinglerecordwithtwofields
{ "first": "Peter", "last": "Parker" }
Page 450