you’re missing out on one of the best features in thunkable - any component block - or what i started calling as “indexible buttons” (or components).
please read this tutorial to give you an idea if this process would work for you.
the outcome is you end up with a table of buttons that are numbered button1 to buttonP (where P is total rows times total columns). you will need an internal table ot translate that button1 is for the location of H in the json table, that buttons 2 thru 17 are not used but button18 points to the location of He in the json table.
when any button is pressed, you get a number that can be translated to an index, and the index can be used to get the element info from json table.
but the way you’ve started coding it, you will end up with coding 119(!) When_Buttonxx_Clicked blocks!
i dont know enough thunkable internals - the way you chose may be faster because each button is directly related to a when_clicked block.
if you still want to ability to successive displays of element in sequence, you stilll need the internal table i described above so if you know that button 39 was pressed, you know that the next button will be button 40. you wont need to check if button-sulfur is followed by button-chlorine.
this is just my observation - you may receive other suggestions from other thunkable users. good luck.