How to call data from firebase when alphabetized?

I am working on a project that requires data being put into the firebase realtime database, to be recalled and added to a list. However, regardless of what data I add, it ends up being alphabetized and so I can’t recall that data by finding it through substrings. These are the blocks I am currently using, but it won’t work since the data is not split into a list properly, and the data is not sorted by most recent, rather it is alphabetized.

This is an example of the json that is called for the data:

How do I sort this data and add it to the list on thunkable? When I try doing it through substrings, it ends up repeating the first item on the json file and adding it multiple times as a text item on the list. Can I fix the data coming in into the realtime database and stop it from alphabetizing by altering my security rules?

@cloud9innovated34i7 Hello! I think you need to save day & time in each of these data when you create them in order to be able to sort them by the most recent. But it is difficult. Maybe it would be easier to use Google spreadsheet or Airtable.

1 Like

This is exactly what I’ve done for a photo journal app I made. I either use a timestamp (date and time) for the key name or a add a new key:value pair that is of the form timestamp:[date and time] and then search/sort those entries within Thunkable.

Another option is Airtable which has a really powerful and fast filterByFormula as part of its API.

1 Like

Hi, thanks for the suggestions! I’ll check out Airtable but for adding timestamps, how would I go about that in blocks and save it to the key:value pairs in the data on firebase?

You could use the built-in Thunkable time blocks in the Device drawer along with join or other Text blocks to construct the timestamp the way you want it to look. Or you could use a Javascript script to retrieve the current timestamp it in a certain format.

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