(Sorry)
So expanding on what I just said:
This is the flow - as an example.
[{"id":"1dd69628.a44192","type":"change","z":"88de1ac2.8b8c38","name":"ALL channels used (name/number) *","rules":[{"t":"set","p":"nine","pt":"flow","to":"100","tot":"num"},{"t":"set","p":"fox1","pt":"flow","to":"101","tot":"num"},{"t":"set","p":"abc","pt":"flow","to":"102","tot":"num"},{"t":"set","p":"sbs","pt":"flow","to":"104","tot":"num"},{"t":"set","p":"uktv","pt":"flow","to":"105","tot":"num"},{"t":"set","p":"seven","pt":"flow","to":"107","tot":"num"},{"t":"set","p":"fox8","pt":"flow","to":"108","tot":"num"},{"t":"set","p":"ten","pt":"flow","to":"110","tot":"num"},{"t":"set","p":"showcase","pt":"flow","to":"112","tot":"num"},{"t":"set","p":"sifi","pt":"flow","to":"116","tot":"num"},{"t":"set","p":"classic","pt":"flow","to":"117","tot":"num"},{"t":"set","p":"bbcfirst","pt":"flow","to":"119","tot":"num"},{"t":"set","p":"universal","pt":"flow","to":"120","tot":"num"},{"t":"set","p":"history","pt":"flow","to":"130","tot":"num"},{"t":"set","p":"discovery","pt":"flow","to":"133","tot":"num"},{"t":"set","p":"natgeo","pt":"flow","to":"139","tot":"num"},{"t":"set","p":"boxsets","pt":"flow","to":"150","tot":"str"},{"t":"set","p":"abccomedy","pt":"flow","to":"152","tot":"num"},{"t":"set","p":"seven2","pt":"flow","to":"156","tot":"num"},{"t":"set","p":"sevenmate","pt":"flow","to":"157","tot":"num"},{"t":"set","p":"sevenflix","pt":"flow","to":"158","tot":"num"},{"t":"set","p":"ninego","pt":"flow","to":"162","tot":"num"},{"t":"set","p":"ninegem","pt":"flow","to":"164","tot":"num"},{"t":"set","p":"viceland","pt":"flow","to":"170","tot":"num"},{"t":"set","p":"fox1-plus2","pt":"flow","to":"201","tot":"num"},{"t":"set","p":"uktv-plus2","pt":"flow","to":"205","tot":"num"},{"t":"set","p":"fox8-plus2","pt":"flow","to":"208","tot":"num"},{"t":"set","p":"showcase-plus2","pt":"flow","to":"212","tot":"num"},{"t":"set","p":"sifi-plus2","pt":"flow","to":"216","tot":"num"},{"t":"set","p":"classic-plus2","pt":"flow","to":"217","tot":"num"},{"t":"set","p":"discovery-plus2","pt":"flow","to":"233","tot":"num"},{"t":"set","p":"natgeo-plus2","pt":"flow","to":"239","tot":"num"},{"t":"set","p":"viceland-hd","pt":"flow","to":"270","tot":"num"},{"t":"set","p":"worldmovies","pt":"flow","to":"433","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":110,"wires":[[]],"info":"All names are written in lower case.\nChannels like `72` are written as `seven2`\nFox8 are written as `fox8`\nAll `+2` channels are appended with `-plus2`"},{"id":"3b806e2e.f235fa","type":"inject","z":"88de1ac2.8b8c38","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":110,"wires":[["1dd69628.a44192"]]},{"id":"cf0cd74b.0b68","type":"ui_template","z":"88de1ac2.8b8c38","group":"f1fdb5d4.16549","name":"Blank","order":11,"width":"7","height":1,"format":"<div id=\"regular_x\">\n <md-button class=\"md-button program-names teal\">BLANK\n </md-button>\n</div>\n\n<script>\n\n(function($scope) {\n\n$('#regular_x').on('click', function(e) {\n e.preventDefault(); //prevent default behavior\n $scope.send({\"topic\":\"momentary_regular\",\"payload\": \"abccomedy\"});\n});\n \n})(scope);\n</script>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":330,"y":180,"wires":[["78bf5335.6271f4","945485eb.0bd93"]]},{"id":"78bf5335.6271f4","type":"function","z":"88de1ac2.8b8c38","name":"Magic node","func":"\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":180,"wires":[["39cbf291.a66396"]]},{"id":"945485eb.0bd93","type":"debug","z":"88de1ac2.8b8c38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":440,"y":230,"wires":[]},{"id":"39cbf291.a66396","type":"debug","z":"88de1ac2.8b8c38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":180,"wires":[]},{"id":"f1fdb5d4.16549","type":"ui_group","z":"","name":"Programs","tab":"cead8e37.ba09a","order":1,"disp":true,"width":"8","collapse":false},{"id":"cead8e37.ba09a","type":"ui_tab","z":"","name":"Schedule","icon":"dashboard","order":10,"disabled":false,"hidden":false}]
The button is pressed and abccomedy
is sent to the magic node and it finds the association between abccomedy
and 152
then spits out the 152
value.
Maybe it would/could be easier if the list was an array. Again: this is just to show the idea.