To expedite adding large sets of data the “Import CSV” feature which can be accessed by clicking on the “Import CSV” button. This will bring up a dialog that allows the user to paste in CSV data and a text box for specifying the name of the to be created data instance. The CSV should be in the format of
level_1_header,level_2_header,level_3_header,...,level_N_headerlevel1data,level2data,level3data,...,leveNdatalevel1data,level2data,level3data,...,leveNdatalevel1data,level2data,level3data,...,leveNdatalevel1data,level2data,level3data,...,leveNdata
For example:
District,County,NeighborhoodCharsadda,Charsadda,AgraCharsadda,Charsadda,Amba DheriCharsadda,Charsadda,BehlolaCharsadda,Charsadda,Charsadda MC-ICharsadda,Tangi,AbazaiCharsadda,Tangi,DakaiCharsadda,Tangi,Deri ZardalCharsadda,Tangi,DhakkiCharsadda,Shabqadar,Shabqadar1Charsadda,Shabqadar,Shabqadar2Charsadda,Shabqadar,Shabqadar3Charsadda,Shabqadar,Shabqadar4DI Khan,Paharpur,Paharpur1DI Khan,Paharpur,Paharpur2DI Khan,Paharpur,Paharpur3DI Khan,Paharpur,Paharpur4DI Khan,Kulachi,Kulachi1DI Khan,Kulachi,Kulachi2DI Khan,Kulachi,Kulachi3DI Khan,Daraban,Daraban1DI Khan,Daraban,Daraban2DI Khan,Daraban,Daraban3DI Khan,DI Khan,DI Khan4DI Khan,DI Khan,DI Khan5Hangu,HanguTehsil1,HanguTehsil1UC1Hangu,HanguTehsil1,HanguTehsil1UC2Hangu,HanguTehsil1,HanguTehsil1UC3Hangu,HanguTehsil2,HanguTehsil2UC1Hangu,HanguTehsil2,HanguTehsil2UC2Hangu,HanguTehsil2,HanguTehsil2UC3Hangu,HanguTehsil3,HanguTehsil3UC1Hangu,HanguTehsil3,HanguTehsil3UC2Hangu,HanguTehsil3,HanguTehsil3UC3
Itemsets allow a select or select1 question to use nodes from a data model instance as the options.
The label and value elements in the itemset element are used to set which attributes are to be used as the label (shown to the user) and value (stored in the database) of the select options.
The form builder now has an “Add Data” menu that allows the user to add new instances solely for storing data for itemsets and adding new elements to the data instances.
The “Add Data Instance” button adds a new data model instance to the xform.
The “Add Data Element” will add a new element to a data instance. By default the data elements contain a value and label attribute for storing the value saved in the database and the label shown to the user.
The data instance properties view only allows the user to change the data instance id. This is the ID of the instance in the xform. This also changes the name of the root node in the data instance.
The data element properties view allows the user to set the name of the element. The name of the element must conform to XML rules and cannot have reserved characters, such as spaces. The properties view also lets the user add, edit, and remove attributes of the given data element.
To use an item set on a select or select1 question, in the question's properties view check the “Use Itemset” check box. The form builder will now show the item set as a child of the select or select1 question.
The itemset properties view allows the user to pick the data instance to use, the value attribute and label attribute to use, as well as the various levels and predicates into the item set. Due to limited development time, the form builder only supports one predicate per level. For example: nodeset: “instance('locales')/locales/province= /myForm/province?/district” as opposed to: nodeset: “instance('locales')/locales/province= /myForm/isNorthern?> /myForm/population?/district”
Also, due to limited development time, the form builder only support the equals binary comparison operator. The ODK collect client should support any binary comparision operator, for example, the form builder has no way to create the following, even though it will work in Collect: nodeset: “instance('locales')/locales/province> /myForm/population?/district”
When editing a itemset in the FB the user will need to keep in mind that there must be at least one “level” so the user has something to choose from. Each time there is more than one level, and the user wants to select only certain elements from the previous element, the use should add a predicate that filters based on the given attribute by another question in the form.
To expedite adding large sets of data the “Import CSV” feature which can be accessed by clicking on the “Import CSV” button. This will bring up a dialog that allows the user to paste in CSV data and a text box for specifying the name of the to be created data instance. The CSV should be in the format of
level_1_header,level_2_header,level_3_header,...,level_N_header level1data,level2data,level3data,...,leveNdata level1data,level2data,level3data,...,leveNdata level1data,level2data,level3data,...,leveNdata level1data,level2data,level3data,...,leveNdata
For example
Country,Province USA,Alabama USA,Alaska Nigeria, Lagos State Nigeria, Abuja
The header row, which is the first row, will be used as the name for the elements of different levels, and thus must conform to XML rules and not contain reserved characters (spaces, <, >, and such). The data in the following rows of the CSV file will be used as the label attribute of the elements created. The value attribute will be created automatically as a incrementing integer. For example in the above example of countries and provinces the following data instance would be created if I gave the instance the name “countries”
<instance id="countries"> <countries> <Country label="USA" value="1"> <Province label="Alabama" value="1"/> <Province label="Alaska" value="2"/> </Country> <Country label="Nigeria" value="2"> <Province label=" Lagos State" value="3"/> <Province label=" Abuja" value="4"/> </Country> </countries> </instance>}}}
--
You received this message because you are subscribed to the Google Groups "Kobo Users" group.
To post to this group, send email to kobo-...@googlegroups.com.
To unsubscribe from this group, send email to kobo-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/kobo-users?hl=en.
best regards,