Save and reuse (read only) multiple unique lists

Hi all!

I am struggling with an idea that’s for me feels quit advanced… But maybe it’s not if you know what to do🙂
I am wondering if you guys could help me out with any tips?

So, I have now built an app which works like this:

Its an app where I can enter the days that I have NOT been at office.
It starts with a simple DVL list where I can add new data to it.
I have made that the items/data in this DVL also are mirrored in a variable just to be ably to use later if I would need to. This variable is called “myList”.

When I have filled the list for one year I would like to save this list somewhere so that I can go back to it (as a user and read only) if I’d d like to. This is set up and works fine, I am just read the data from this variable “myList” and put it in a List Viewer on another screen. Works great!

BUT, the problem is that, for now, this list will always be what’s in my DVL. So if I save this list and call it ex 2021, I will then see this data in my ListViewer, but for next year, I will reset the DVL (and therefore also my “myList”-variable), and next time I save the DVL list for 2022, my previous saved list (2021) will now show the data for 2022 as, I am just mirror the DVL in my variable.

I hope I make my self clear in my issue.
I am wondering how I could save my list (DVL/variable) for ex 2021, and then be able to start all over but my data in that saved list for 2021 are not effected by new entries for 2022.
It’s like I would wanna “copy” my DVLs data, and “paste” it in a new list viewer/variable as a new separate list for every time I save my DVL at the end of a year.

maybe the solution is silly but I am just missing it for some reason, or it is not even possible?
Thanks for any ideas.

/Andreas

2 Likes

There are many ways to achieve this.

  • You can save your list in Firebase under a key such as the year (2021). You will have a separate list for each key.
  • You can save the list in a Google sheet or Airtable by adding extra column with the year. You will have each list with the year repeated for each row and therefore you can easily retrieve them when needed.
  • You can create a text from the list and send it by email.
  • You can create a text from the list and share it with any other app such as WhatsApp or Telegram.
  • You can create a CSV file from it and save it to your phone. I made a demo app to save contact info which you can use the same and build it for CSV.
  • You can show it to the user as text and ask the user to copy and past it to any kind of “notes” app for later use.

I could go on and on with other ideas but hopefully you got what I mean.

1 Like

Thanks Muneer.
I am still struggling with this. I thought that your idea with Firebase was kind of what I was looking for, but I thought I could do it even more basic by using the LocalStorage in Thunkable. That way I could save my list under a key which could be my textInput (ex 2021).
I thought that maybe that could work, but I feel very confused in how to set that up.
could you give me some guidance?

Here’s a link with a video of how the app is working at the moment.

And this is the block for saving this “year” at the moment:
Screenshot 2021-08-17 at 13.55.15

This is when I click the “entry” in the alert-message:
Screenshot 2021-08-17 at 13.57.13

And I am simply view that list in another screen with this block:
Screenshot 2021-08-17 at 13.56.40

I have tried this block to save the list within a specific year: (this and many other methods)
Screenshot 2021-08-17 at 13.43.33

But as you understand I am not thinking straight in this…but at least maybe you will understand my idea? I thought I could add the TextInput text in a variable and use that as a key and save the current DVL in that key. And later I could call on that key and view that saved list from within that key.

Any guidance would be much appreciated.
Thanks :pray:

2 Likes

It’s very hard to try to explain an idea that is not using the conventional way of using lists therefore I built a starter app to demonstrate the idea.

You can enter items in the list and then choose to save it as current list or as a list with the title of your choice.

The first input is for the data entry and the second input is for the list title.

You can then use the Load List button to either load current list or the list name you type in the second input.

https://x.thunkable.com/projectPage/611bde48ffbfbb0011b60671

Hope this is close to what you are thinking of.

2 Likes

Hi
Muneer, Thanks again for your ideas and support!
Even though I didn’t follow your ideas exactly I got inspired and somehow I got it working at last…

These are my blocks now:

For saving a list as an item named after the textfield:

When klick on one of these items (years) that specific years list will open in another screen (Or you can choose to delete that list):

The screen that will show this selected years list simply do this:
Screenshot 2021-08-19 at 13.43.22

I do have one concern though.
This works great inside thunkables “LiveTest”-feature. But when I want to view it through my Iphone 6s the app crashes when do that first block (For saving a list as an item named after the textfield in a list)

Do you have any idea what that could be about?

Here are a video link showing how the app works inside of Thunkable LiveTest-feature.

Thanks!

2 Likes

Can you share a link of a sample project that has this issue.

I tested my code on iPhone 7 and it works fine.

Yea sure.

https://x.thunkable.com/copy/c4bec3b5949bee61414a2a9722593d3f

So, this works great in the liveTest-feature on both my office Mac and my private MacBook. but not on my iPhone 6s.

thanks

2 Likes

See my screenshots

This is to show that I selected 2005

This is to show all steps where successful and my phone did not crash.

1 Like

Ok thanks, so, just to clarify, you have not added or changed anything in the code here? Except for that label showing the result?
And you are using iPhone 7?

Really weird, I will try to download it and install and see if it will behave any different then.

And you can not see anything weird in the blocks that could be causing this behaviour?
I was planning to add some if-statements just to make sure I am not saving empty strings or get errors on the way, but first I’d like to know that the app is working as suspected…

Could this be a bug in Thunkable only for iPhone 6s’s? Should I report it somewhere?

1 Like

Actually, I tested it on both Android and iOS and found that it crashed in both so I added the label and a wait block to see at what stage the app crashes and found that it fixed itself.

All what you need is to add a wait block inside the first save block and before the second save block which is inside the first one and it will work fine.

Ah ok thanks for that! I will give it a try! :slightly_smiling_face:

1 Like

is this what you mean?

the app is still crashing on my iPhone 6s, but the LiveTest-feature still works fine for me…
:face_with_raised_eyebrow:

1 Like

Yes, and it works fine for me on both Android and iOS

This video is from Android but my iPhone 7 is also showing the same.

I also noticed that you do not check for duplicates in the Year list resulting in multiple entries for the same year.

Hm…
It seam to be something with the year variable…
If I change variable To something else and don’t navigate to another screen the app won’t crash, it won’t do what I want either of course but that could be a sign that something is not right with that variable. Could it be what you said, that I do not check for any duplicates? Could that make the app crash?

1 Like

Hi again @andreas.sjdtomypv

I did more test and found out that the problem is in the Screen Opens block.
You are trying to get the content of the year and the problem is that the Local Storage will send a TEXT of null if the key has no data. This will force your variable to change from list to text and when you try to add the entered year to the list variable in the “save button” the app will crash.

I was able to fix the situation be this change.
image

You don’t need a wait block. This is a mistake from my side.

Try and let me know.

Hi Muneer and thanks!
That was it!
Now the app works in both liveTest-feature and Iphone…

Thanks for this, I wouldn’t clear that out my self…
:pray:

/

1 Like