Updating label from Firebase

I'm a total newbie to App Inventor and have created the app to read data from a Firebase database.

One of the items is when the data was last updated and it is stored in this format: 10/27/2023 8:31:14 ET.

I have a block that updates the label with the last update date/time that it receives from Firebase.

However, it is only showing 10. I think it's because it trims on the '/'. So I switched it to a "-" and it showed the full 10-27-2023, but dropped the time.

My questions is how do I configure the block update so that it picks up all the data including / and spaces.

This is the simple statement I'm currently using:

Show how you store the data in Firebase, both the program code that stores it, and how it looks in the Firebase console.

The data in Firebase is stored as a string like this - f_lastupdated:"10/27/2023 11:27:12 ET"

and in my original code the variable is also declared as a string (String lastupdated; ).

It's nothing fancy, but in the app is the "/" and the space that are causing the issue. So my question is how do I code it in MIT App Inventor to ignore these characters and update the label with the full string.

Had you used the Firebase component to store the data in Firebase, those / characters would have been escaped to allow them to be read by the Firebase component.

Here are other ways to handle this:

1 Like