resetOnChange but keep history

Hello,
I have successfully figured out how to use resetOnChange in a button to wipe out a table but I’m also trying to keep a summary of previous attempts. Is this possible? I’m still a newbie in CL. Here’s my activity (I’m trying to make screen 4 work):

TIA!

Assuming that “c” and “g” from Graph 2 are the variables you want to keep a history of, then you can use the button to capture those variables each time it is pressed (ie. capture("c"): graph2.number("c") etc.)

Then you can re-access each attempt with button1.history("c").elementAt(...). I haven’t specifically tested this but something like:

cellContent(1,2): when s<=1 "${button1.history("c").elementAt(1)}" otherwise ""
cellContent(2,2): when s<=2 "${button1.history("c").elementAt(2)}" otherwise ""
cellContent(3,2): when s<=3 "${button1.history("c").elementAt(3)}" otherwise ""
cellContent(4,2): when s<=4 "${button1.history("c").elementAt(4)}" otherwise ""

should be what you’re looking for.

1 Like

Thank you again!!! I added in the ${button1.history(“c”).elementAt(1)}" in the otherwise “” or else the row was blank with each new attempt. I learned that from your other post :smile: