Resetting a graph component string with a button press

I am setting up a screen where students enter expressions in table, then press a button to have their expressions show up on a graph.

in the graph I am using:
str1 = when button1.pressCount > 0 table1.cellContent(1,1) otherwise “”
function(“f”): simpleFunction(str1)

When students tap to reset the button, I want the graph (or maybe the table?) to clear and new graphs only to show up upon a new button press.

What I have is that the button resets, but the strings change with updates (not another button press) based on my pressCount > 0 above. What can I do to reset the string when the button is pressed and reset?

It sounds like if you use button1.timeSuncePress>0 instead of pressCount, it should work. Would you mind sharing an example so we can see your intentions? Sometimes it’s easier to help that way. :grinning:

Thanks. Screen 2 in this: CL Templates • Activity Builder by Desmos
The graphs show with button press, but resetting the button doesn’t reset the strings to blank, which is what I’m after.

If students change the equations, I would like them to show upon a second button press

This code resets the graph to blank when you edit the table. I don’t believe it’s possible to clear the table like you can with a math input component.

str1 =  when button1.timeSincePress>0 table1.cellContent(1,1) 
        otherwise ""
str2 =  when button1.timeSincePress>0 table1.cellContent(2,1) 
        otherwise ""
       

function("f"): simpleFunction(str1)
function("g"): simpleFunction(str2)

Thank you! I didn’t understand the timeSincePress sink, but now I get it and this is what I had wanted.