title: How to Update KivyMD Label in the first screen with on_enter function?
body: <p>Give below is the kivyMD screen manager program from <a href="https://github.com/attreyabhatt/KivyMD-Basics/blob/master/13%20-%20Switching%20Screens/main.py" rel="nofollow noreferrer">https://github.com/attreyabhatt/KivyMD-Basics/blob/master/13%20-%20Switching%20Screens/main.py</a></p>
  <p>and I have added it to the official navigation drawer program <a href="https://kivymd.readthedocs.io/en/latest/components/navigation-drawer/index.html" rel="nofollow noreferrer">https://kivymd.readthedocs.io/en/latest/components/navigation-drawer/index.html</a> of KivyMD.</p>
  <p>This program works perfectly, but I want to change the text in the MenuScreen with the on_enter function.
  I have commented the <code>def on_enter</code> inside <code>class MenuScreen</code>.
  If we run it uncommented shows this error:</p>
  <pre><code> Traceback (most recent call last):
     File &quot;kivy\properties.pyx&quot;, line 861, in kivy.properties.ObservableDict.__getattr__
   KeyError: 'label_id'
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File &quot;C:/Users/Administrator/PycharmProjects/kivy_prj1/kivy_mainmd/nav_screen.py&quot;, line 170, in &lt;module&gt;
       sm.add_widget(MenuScreen(name='menu'))
     File &quot;C:\Users\Administrator\pyenv\lt_kivyvirt\lib\site-packages\kivy\uix\screenmanager.py&quot;, line 997, in add_widget
       self.current = screen.name
     File &quot;kivy\properties.pyx&quot;, line 498, in kivy.properties.Property.__set__
     File &quot;kivy\properties.pyx&quot;, line 545, in kivy.properties.Property.set
     File &quot;kivy\properties.pyx&quot;, line 600, in kivy.properties.Property.dispatch
     File &quot;kivy\_event.pyx&quot;, line 1248, in kivy._event.EventObservers.dispatch
     File &quot;kivy\_event.pyx&quot;, line 1154, in kivy._event.EventObservers._dispatch
     File &quot;C:\Users\Administrator\pyenv\lt_kivyvirt\lib\site-packages\kivy\uix\screenmanager.py&quot;, line 1062, in on_current
       screen.dispatch('on_enter')
     File &quot;kivy\_event.pyx&quot;, line 709, in kivy._event.EventDispatcher.dispatch
     File &quot;C:/Users/Administrator/PycharmProjects/kivy_prj1/kivy_mainmd/nav_screen.py&quot;, line 156, in on_enter
       self.ids.label_id.text = &quot;Label text Updated&quot;
     File &quot;kivy\properties.pyx&quot;, line 864, in kivy.properties.ObservableDict.__getattr__
   AttributeError: 'super' object has no attribute '__getattr__'
  </code></pre>
  <p>'label_id' is the id of my label that is to be changed.</p>
  <pre><code>from kivy.lang import Builder
  from kivy.uix.boxlayout import BoxLayout
  from kivy.properties import StringProperty, ListProperty
  
  from kivymd.app import MDApp
  from kivymd.theming import ThemableBehavior
  from kivymd.uix.list import OneLineIconListItem, MDList
  from kivy.uix.screenmanager import ScreenManager, Screen
  
  KV = '''
  # Menu item in the DrawerList list.
  &lt;ItemDrawer&gt;:
      theme_text_color: &quot;Custom&quot;
      on_release: self.parent.set_color_item(self)
  
      IconLeftWidget:
          id: icon
          icon: root.icon
          theme_text_color: &quot;Custom&quot;
          text_color: root.text_color
  
  
  &lt;ContentNavigationDrawer&gt;:
      orientation: &quot;vertical&quot;
      padding: &quot;8dp&quot;
      spacing: &quot;8dp&quot;
  
      AnchorLayout:
          anchor_x: &quot;left&quot;
          size_hint_y: None
          height: avatar.height
  
          Image:
              id: avatar
              size_hint: None, None
              size: &quot;56dp&quot;, &quot;56dp&quot;
              source: &quot;data/logo/kivy-icon-256.png&quot;
  
      MDLabel:
          text: &quot;KivyMD library&quot;
          font_style: &quot;Button&quot;
          size_hint_y: None
          height: self.texture_size[1]
  
      MDLabel:
          text: &quot;kivydevelopment@gmail.com&quot;
          font_style: &quot;Caption&quot;
          size_hint_y: None
          height: self.texture_size[1]
  
      ScrollView:
  
          DrawerList:
              id: md_list
  
  
  
  Screen:
      ScreenManager:
          MenuScreen:
          ProfileScreen:
          UploadScreen:
  
      NavigationLayout:
  
          ScreenManager:
  
              Screen:
  
                  BoxLayout:
                      orientation: 'vertical'
  
                      MDToolbar:
                          title: &quot;Navigation Drawer&quot;
                          elevation: 10
                          left_action_items: [['menu', lambda x: nav_drawer.toggle_nav_drawer()]]
  
                      Widget:
  
  
          MDNavigationDrawer:
              id: nav_drawer
  
              ContentNavigationDrawer:
                  id: content_drawer
  
  
  &lt;MenuScreen&gt;:
      name: 'menu'
      MDRectangleFlatButton:
          text: 'Profile'
          pos_hint: {'center_x':0.5,'center_y':0.6}
          on_press: root.manager.current = 'profile'
      MDRectangleFlatButton:
          text: 'Upload'
          pos_hint: {'center_x':0.5,'center_y':0.5}
          on_press: root.manager.current = 'upload'
      MDLabel:
          id:label_id
          text: 'update this at on enter'
          pos_hint: {'center_x':0.5,'center_y':0.4}
          halign: 'center'
      
  &lt;ProfileScreen&gt;:
      name: 'profile'
      MDLabel:
          text: 'Profile'
          halign: 'center'
      MDRectangleFlatButton:
          text: 'Back'
          pos_hint: {'center_x':0.5,'center_y':0.1}
          on_press: root.manager.current = 'menu'
          
  &lt;UploadScreen&gt;:
      name: 'upload'
      MDLabel:
          text: 'Upload'
          halign: 'center'
      MDRectangleFlatButton:
          text: 'Back'
          pos_hint: {'center_x':0.5,'center_y':0.1}
          on_press: root.manager.current = 'menu'
  '''
  
  
  class ContentNavigationDrawer(BoxLayout):
      pass
  
  
  class ItemDrawer(OneLineIconListItem):
      icon = StringProperty()
      text_color = ListProperty((0, 0, 0, 1))
  
  
  &quot;&quot;&quot;Instead of just giving MDList in kv file give DrawerList for adding the ThemableBehavior with it and created color 
  changing fn &quot;&quot;&quot;
  
  
  class DrawerList(ThemableBehavior, MDList):
      def set_color_item(self, instance_item):
          &quot;&quot;&quot;Called when tap on a menu item.&quot;&quot;&quot;
  
          # Set the color of the icon and text for the menu item.
          for item in self.children:
              if item.text_color == self.theme_cls.primary_color:
                  item.text_color = self.theme_cls.text_color
                  break
          instance_item.text_color = self.theme_cls.primary_color
          # print(f&quot;inst:{instance_item.text_color}&quot;, f&quot;thm_txt{self.theme_cls.text_color}&quot;,
          #       f&quot;thm_prm{self.theme_cls.primary_color}&quot;)
  
  
  class MenuScreen(Screen):
      pass
      # def on_enter(self, *args):
      #     self.ids.label_id.text = &quot;Label text Updated&quot;
  
  
  class ProfileScreen(Screen):
      pass
  
  
  
  class UploadScreen(Screen):
      pass
  
  
  # Create the screen manager
  sm = ScreenManager()
  sm.add_widget(MenuScreen(name='menu'))
  sm.add_widget(ProfileScreen(name='profile'))
  sm.add_widget(UploadScreen(name='upload'))
  
  
  class TestNavigationDrawer(MDApp):
      def build(self):
          return Builder.load_string(KV)
  
      def on_start(self):
          icons_item = {
              &quot;folder&quot;: &quot;My files&quot;,
              &quot;account-multiple&quot;: &quot;Shared with me&quot;,
              &quot;star&quot;: &quot;Starred&quot;,
              &quot;history&quot;: &quot;Recent&quot;,
              &quot;checkbox-marked&quot;: &quot;Shared with me&quot;,
              &quot;upload&quot;: &quot;Upload&quot;,
          }
          for icon_name in icons_item.keys():
              self.root.ids.content_drawer.ids.md_list.add_widget(
                  ItemDrawer(icon=icon_name, text=icons_item[icon_name])
              )
  
  
  TestNavigationDrawer().run()
  </code></pre>
  <p>So anybody knows how to change the first screens label or anything from on_enter in KivyMD?
  Note: Uncomment the <code># def on_enter(self, *args): #     self.ids.label_id.text = &quot;Label text Updated&quot;</code> this.
  It will show the error.</p>