Change Button1 text on Screen1 when Button2 clicked on Screen2

Hi everyone :slight_smile:
I am trying to figure this out and would greatly appreciate to be pointed in the right direction.
I would like to change the text on a button on one screen after another button on a different screen has been clicked.


I am currently going over different tutorials but can’t really wrap my mind around it so far.
I am planning to publish my app as a web app.

My idea is to use a variable in order to achieve that. However, I currently don’t fully understand how to store the value. I have a feeling storing it in a database would be the best option, but I am really not sure.

If someone knows about a tutorial that will help me with that, please let me know. I don’t expect to get my full solution served here :slight_smile: I am just currently lost on what to spend my research and learning time on.

Thanks a million,
Antje

Hi antje.smilesyft !

Thanks for asking this question ! I admit that some issues might be difficult to solve by yourself when it comes with variables ^^

I don’t know if it’s the easiest way to do that but that’s my advice :

  • create a variable (call it as you wish, for exemple button1_name)
  • give it a start value (it might be “null” or “text” (whatever you want))
  • add in Screen 2 a block called “when button 2 is clicked”
  • create a block in it that call app button1_name and set a new text with a text block

Hope it will solve your problem.
If you have trouble to that, fell free to let me know ! In this case I’ll try to get into more detail ^^

Have fun nocoding :slight_smile:
Sam

1 Like

Create a stored variable called storedText

When the button on screen 1 is clicked, set storedText to the correct text

When screen 2 loads add a if/then block

Set button text to variable storedText

1 Like

Thanks, Jared. That was actually my initial thought when reading the documentation :slight_smile: I understood that a stored variable is stored on the device. I really don’t have much knowledge about web-apps and am wondering if there might ever be the case where the value can’t be fetched from a previous session. So my specific question for this case is: Do stored variables stay constant over the course of all sessions for web apps, unless I change it?

Thank you

ahaha! I believe they might. but if a user clears their cookies, history, etc that would certainly be lost. My recommendation is to create a login in screen, and to use cloud variables.

I will create an example shortly for webapp purposes. It will display only what the user tells it to!

1 Like

Here you go

_remixLink

See it live

1 Like

Thank you. A login screen is something I still need to do anyways actually.
Your “see it live” link gives me “Oops! The app you are looking for is currently under construction and not available.”
Is there a way to get past the sign-in screen for the live test? If not, it’s ok. I can still look into the screens and blocks you created and see the logic there.

Sorry if I might be asking lots of noob questions :sweat_smile:
Thanks again

Sorry! I deleted the app from my lineup, i forgot that also deletes the published web app. I wont be adding it back to my app lineup today, but will likely add it to my sandbox project. I encourage you to set this up yourself to understand the process (or practice) setting up firebase authentication with a template (as provided).

if you get caught up on the blocks, message back though and i’ll be happy to assist!

1 Like