{"id":5560,"date":"2025-01-01T04:09:20","date_gmt":"2025-01-01T04:09:20","guid":{"rendered":"https:\/\/obsidiansofteducation.com\/?page_id=5560"},"modified":"2025-05-12T05:07:27","modified_gmt":"2025-05-12T05:07:27","slug":"customer-record-app-in-mit-app-inventor-database-records-part-2","status":"publish","type":"page","link":"https:\/\/obsidiansofteducation.com\/index.php\/customer-record-app-in-mit-app-inventor-database-records-part-2\/","title":{"rendered":"Customer Record App in MIT App Inventor &#8211; Database Records Part 2"},"content":{"rendered":"\n<p class=\"has-medium-font-size\">Hello friends and welcome to Obsidian Soft,<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/23.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEih8_khz_Sf2jRGsx2zjNPhC4QDyScGmizUa9za5XEcROgKEVAfcNPlEqoCLMVDMFNJw-_MrnU7xXy8AiZZPoZrf4sO7jWDnVb-0F8IOk5UIIdSHEk2s_HmA52fIEd8PVFBPAnluZSTj-k8BQatfoicjMU_ZizvhaJU0VyqWpj-OZ5qqqASPHnlJw3p\/s1280\/23.png\" target=\"_blank\" rel=\"noopener\"><\/a><\/p>\n\n\n\n<p class=\"has-medium-font-size\">This is part 2 of the Client\/Customer Record App tutorial.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong><a href=\"https:\/\/obsidiansofteducation.com\/index.php\/customer-record-app-part-1\/\" target=\"_blank\" rel=\"noreferrer noopener\">Part 1 written tutorial here<\/a><\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">Go to Designer View and duplicate the mainScreenLayout. (Select it first and press Ctrl + C and Ctrl + V for Windows or Command + C and Command + V for MacOS) Rename it to UpdateScreenLayout and delete the list view and the horizontal layout with reload and delete all buttons from it. Rename addBtn2 to saveBtn and change the text to Save. Rename findBtn2 to deleteBtn and change the text to Delete.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Now, make this UpdateScreenLayout invisible by unchecking visible.&nbsp;<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Go to the block section.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Add another global variable for the selectedRecordIndex when the user touches an item on the listview.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"726\" height=\"108\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-19.png\" alt=\"\" class=\"wp-image-5562\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-19.png 726w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-19-300x45.png 300w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">We are using the concept of virtual screens here i.e. two full-screen layouts out of which only one is visible at one time. When the screen is initialized, we want to make sure that only our mainscreenlayout is showing. So, add the following code to screen1.initialize event.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"966\" height=\"168\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-20.png\" alt=\"\" class=\"wp-image-5563\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-20.png 966w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-20-300x52.png 300w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-20-768x134.png 768w\" sizes=\"auto, (max-width: 966px) 100vw, 966px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">Next, we will show the updateScreenlayout when the user taps on a record on the listview with the filled-in values of the record on which the user has tapped. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/05\/AD_4nXcmRiT6x3JONDuP8aQDUi4yA9b9C70XBCaVfswFi3Ezutm1erC0hZ7uVVZOKkUFA0iAK8PJ5dY5bC2VNvC3emAri1g6KFoXt0_WcvGdHITM6nxpxl8xxZOm831IinE9xW9OO9ySLBlCC3SyaRJAxz1heUQkeylUOteUCCKVfAHCORoVQkAw.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">Now, the user can either make some changes and press save or he can delete the entire record.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">If he presses save, the code is similar to addBtn code. We make a dictionary and set it to global record but this time, we replace it in the list for the chosen index. In the end, we also set selectedindex back to 0. Why? You will know the reason soon.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"495\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-22-1024x495.png\" alt=\"\" class=\"wp-image-5566\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-22-1024x495.png 1024w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-22-300x145.png 300w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-22-768x371.png 768w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-22-1536x742.png 1536w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-22.png 1540w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">Now, empty the delete button code as it was duplicated from findBtn and put code in it for removing the item from the list for the selectedRecordIndex and storing the list in tinyDB, and updating listview by calling custom procedure and making our update screen invisible. In the end, again make selectedRecordIndex 0.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"906\" height=\"544\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-21.png\" alt=\"\" class=\"wp-image-5564\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-21.png 906w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-21-300x180.png 300w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/image-21-768x461.png 768w\" sizes=\"auto, (max-width: 906px) 100vw, 906px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">Now what happens when the user presses the find button? We will assume that he has provided a name before pressing find. Again, you need to add error checks when you are making a&nbsp; professional app.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">We will make a local variable list just like we made in updatelistview procedure but this time we will search in our list of records for the name provided by the user using a for loop where we can know the number i.e. index at which the record is found. We need this while updating the main Record list if the user decides to edit or delete this record by tapping on it. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/05\/AD_4nXfIg3SmfWAnfboMoS-C38KH6Vh96ITUUUVGYj-0ldNMq45uyDCgtr_N1SHDu57IaJ1vmrMPDSwN5TwI11DjEoxOQrJ-vUt3XmKph3PQG4nNitZlOjDyQPK-V0sxj_GtIIPnZHfBdDoXNGfsKgICss-BkkrgkeylUOteUCCKVfAHCORoVQkAw.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">In the end, update listview with this local variable foundList.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Now, we need to make a slight change in our listview\u2019s after-picking event if the picking event happens after the user has looked for a particular customer by pressing the find button then we need to use that index of the found item otherwise just the listview\u2019s selection index.\u00a0 This is why we were making the selectedRecordIndex back to\u00a0 0 at the end of save and delete to differentiate between update after finding the record and update after selecting a record from the entire list.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/05\/AD_4nXdQTiCFfmU5OuVheKAy3dS-82Cx7O6rDisqD0BirjZE9TDoTqIn7rnAFNcSZ6obHomy_0Xb-FXL6ENINT2QSml_sFtMM3NDJi4KrTI4gRblVzyVGNMgKFcSaNp99Xuhe0UWEsGDoxVJupHKNB0sxQhB1lgkeylUOteUCCKVfAHCORoVQkAw.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">At any time, we want to again look at our entire customer records list, we can press reload button which will just call updateListView procedure.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/05\/AD_4nXcTRL80y-o2Hixbe2wu_eJQfgv5-BjS4rtdjqLHtWIpicDD6y2LFBntaBm2vcq40dyKECtcpY9kxeyPsOu3b4JcV6j0JauW0KN2XsbFo_t4FNPTHah64ipskwtcQiftJxKF5VVrSXo1uUHJdBsyFcldh4j8keylUOteUCCKVfAHCORoVQkAw.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">You can also download aia file for this project.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong><a href=\"https:\/\/drive.google.com\/file\/d\/142tKF5L7L6_b__NG8OXs-JNqGom23P4V\/view?usp=share_link\" target=\"_blank\" rel=\"noreferrer noopener\">Customer Record App Part 2<\/a><\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">If you like my tutorials, please consider supporting me:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><a href=\"https:\/\/obsidiansoft.gumroad.com\/l\/cxdft\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"372\" height=\"196\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/donate-button-1.png\" alt=\"\" class=\"wp-image-5381\" style=\"width:277px;height:auto\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/donate-button-1.png 372w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/donate-button-1-300x158.png 300w\" sizes=\"auto, (max-width: 372px) 100vw, 372px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"has-medium-font-size\">And, you can also have a look at the video tutorial here.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<p class=\"responsive-video-wrap clr\"><iframe loading=\"lazy\" title=\"Customer Record App - Part 2 | Dictionary blocks in MIT App Inventor\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/1hUKVMzE8Ts?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<\/div><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">Please like my video and share it with your friends and family. Also, subscribe to my channel and press the bell icon so you don&#8217;t miss any of the great projects I have planned for you.&nbsp;<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><a href=\"https:\/\/www.youtube.com\/c\/obsidiansofteducation\" target=\"_blank\" rel=\"noopener\">https:\/\/www.youtube.com\/c\/obsidiansofteducation<\/a><\/p>\n\n\n\n<p class=\"has-medium-font-size\">Please like my Facebook page and Instagram page for more educational resources and tips.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Facebook:<\/strong> <strong><a href=\"https:\/\/www.facebook.com\/ObsidianSoft\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.facebook.com\/ObsidianSoft\/<\/a><\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Instagram:<\/strong> <a href=\"https:\/\/www.instagram.com\/obsidiansoftapps\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>https:\/\/www.instagram.com\/obsidiansoftapps\/<\/strong><\/a><\/p>\n\n\n\n<p><strong>Pinterest:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-pinterest wp-block-embed-pinterest\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"oceanwp-oembed-wrap clr\"><iframe loading=\"lazy\" title=\"Obsidian Soft\" src=\"https:\/\/assets.pinterest.com\/ext\/embed.html?grid=obsidiansoft&#038;src=oembed\" height=\"900\" width=\"450\" frameborder=\"0\" scrolling=\"no\" ><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">For links to free educational apps, have a look at the&nbsp;<a href=\"https:\/\/obsidiansofteducation.com\/index.php\/mobile-apps\/\" target=\"_blank\" rel=\"noreferrer noopener\">educational apps page<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello friends and welcome to Obsidian Soft, This is part 2 of the Client\/Customer Record App tutorial. Part 1 written tutorial here Go to Designer View and duplicate the mainScreenLayout. (Select it first and press Ctrl + C and Ctrl + V for Windows or Command + C and Command + V for MacOS) Rename [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5560","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/pages\/5560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/comments?post=5560"}],"version-history":[{"count":3,"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/pages\/5560\/revisions"}],"predecessor-version":[{"id":6461,"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/pages\/5560\/revisions\/6461"}],"wp:attachment":[{"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/media?parent=5560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}