How can I read the value of a menu item within a sub menu and make an action as the item is clicked?

Correct.

  1. you click a menu-item
  2. you get the menu-data
  3. you create an if-else-condition
  4. you start a function → regarding the result of → IF-ELSE-CONDITION
if(label === 'xyz') {console.log('do something')}
else {console.log('do something else');}