On device storage - access

Hello everyone,

Quite a noob here so pardon me if my question seem silly.

I have been through the tutorials and through multiple videos on youtube but I can’t seem to make this work.

Here is what I want to do :

You visit a tutorial page and once you finish reading, you click on “completed” button and this triggers a switch from false to true to the variable “Completed”. This variable will in turn be used next time the app is launched to not propose the tutorial but right away get to the main page.

So I figured this should go through an on device storage data since app variables are reset every time we open the app.

So this is what I did :

  • Created an on device database with a “SeenTutorial” property set to boolean
  • On the tutorial page, created a new data record data variable mapped on the database
  • On the button set a logic saying to create a new record on the database
  • On the loading page added an if-else logic to check if the record in position [0] of the database.SeenTutorial is true or false and then get to the right page (if false, get to the tutorial, else get to the main page).

My issue resides apparently in the fact that I do not have the proper Id or location, so is it proper to use bracket notation to access the first item (and only item) in this database ?

My other question is : I am pretty sure my way is too circumvoluted, isn’t there a way to achieve this in a simpler manner ?

Thank you for you help :slight_smile:

Hey,

Yes it would be proper to use the bracket notation. However a simpler idea would probably be to use the flow functions Set item to storage and Get item from storage found in the flow functions marketplace. You can use Set item to storage with e.g. the key seen_tutorial and data to store true/false and in the loading page use Get item from storage with the key seen_tutorial to check its value :slight_smile: Pretty much the same thing but you’ll avoid the record updating hassle.

2 Likes

Hello,

That sounds exactly like what I am looking for, I will try this out and come back to update.

Thank you Cecilia !

Have a great day,

1 Like

Hello,

Worked perfectly fine, thanks !