Send data to a different screen

Hi

I have made a application and I want to send data from Screen3 to Screen1 without going to Screen1, instead going to Screen2.

Thanks,
RR Media

You can use TinyDB to store the data before going to Screen2, then go to Screen2. You can get the data with another TinyDB in Screen1.

Gordon is correct but it's not "another" TinyDB, it's an instance of the same TinyDB. Just drag TinyDB to the Screens that require access to it. Don't rename it and don't rename the namespace.

1 Like

Does a TinyDB tag work for all screens?

1 Like

Hi,
if the data is not so big you can use the below block to send the data on Screen 1.
image

You should use the below block to retrieve the data on Screen 2.

image

you can create an array to share more than one variable.

Regards,

Halil

1 Like

Yes. All of the screens use the same TinyDB.

For more details, see the documentation.

You cannot use the TinyDB to pass data between two different apps on the phone, although you can use the TinyDB to share data between the different screens of a multi-screen app.

1 Like

To get the same TINYDB, the NAMESPACE should be same in both screens right?

I don't think so.

Then how do you send it with tinyDB? Can you please share a picture of the code or something?

Sorry for the inconvenience!

  1. Add a TinyDB component in Screen1 and Screen3.

  2. In Screen3, before going to Screen2, do this:

image

Then, in Screen1, the data will be like this:

image

Note: You must store a value before getting the value, else the system will return the socket 'valueIfTagNotThere'.

1 Like

Thank you much! @Gordon_Lu and @ChrisWard

1 Like

Yes! The TinyDB name and the namespace must be identical for every instance. They are by default.

1 Like

Thank you for the information. Though it is not what I needed. Still, it is really nice of you to send it through :grinning:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.