READ CSV DATA TO LIST, BUILD OBJECT, ITERATE THROUGH CALENDAR BUTTONS FOR LABELING
Ok outline of this post
(1) current state of project with included attached *.aia file
(2) backstory to project
(3) future updates to project (and reason for this post):
(a) need method to read index (1) and (2) from object imported from CSV file
(b) need help with converting repeated code blocks from 'specific' to 'generic'
The current state of the included *.aia file is stable and functioning. The app will allow a user to click on buttons for the month of September 2021 (current month) and display the lunch menu for Northern Middle School, Somerset, Ky, USA. A public school.
The data the buttons are referencing are taken from a CSV file, which is saved to my Google Drive. Once the app starts the CSV data file is read into the app and converted into an object of 13 indexes. The individual indexes are then put together to form 25 separate objects of the 13 indexes. The 25 objects (representing the lunch menu of 13 items for the day) are assigned by an OBJECT INDEX NUMBER to the respective buttons of the month. The app is based on a calendar of 5 weeks for a month. The reason for the 5 weeks for a month is that the school system coordinates all of their lunch menus in this fashion. T
Currently this ability of the app to display this data when the user clicks on a button is STABLE and working. See attached *.aia file.
(a) NEEDED EXPERTISE
What is needed is a relabeling of the individual buttons for the month based on the imported DAY and DATE. These two data points are originally brought in by the CSV file. I am under the assumption that these two data points could be assigned to a new OBJECT (named something...) and then reiterated throughout the buttons based on the number of records imported from the CSV file that corresponds to the number of days of the month.
Please allow me to say that I understand that I could use a dataPicker approach to working with the labeling problem. I would not look to exploring this route of solution at this time. I firmly believe the best route for a solution would be in the understanding of working with an OBJECT solution method. This is mainly based on the data to be imported and the structure of how this data is to be brought into the project.
(b) Lastely, I am completely sure based on the number and format of repeated code in the project that the overall code base could be dramactically shorten.
NOTE: I am aware that there is extra code in the project that is currently diabled. These fragments (as they are disbaled) do not hinder the current functioning of the project. I have left them in the project as lines of thought I am exploring to tackle the button labeling problem.
In closing...
I hope I have been clear on the problems for the project as I understand them.
Thank you again for all who took to time to read this REALLY long post and would offer help.
Attachment Below:
lunchApp.aia (138.4 KB)