Temporary storage in webapp

Is there a way to temporarily store something for example in the user’s session?

I would like to create a web app without user log in. When visiting a page, automatically a data base record is created. However after the create action this created record seems to be no longer accessible. For example I can"t create a magic text using information from this newly created record. What would be the beste way to solve this?

Thanks
Julian

1 Like

Without a user login there is no ‘user session’ in the technical sense.
Not knowing too much about your app’s requirements, I’ll try to address the ‘data linkage’ aspect of your post.

One way to get this data onto your screen is to add a ‘collection’ component onto your page (you can have a collection of one, if needed)
Another option is to add an input field component, which you can set to a default value.
You can then use magic text in the collection component field/s and in the input field.
Screenshots attached from my test app showing a collection and an input field linked to a database collection named ‘Foo’, where a new ‘Foo’ entry is created each time the page is accessed.

collection|661x500

1 Like

Hi @Julian,

I think you have two different things in one question.

  1. As for the equivalent of “session” for non-logged-in users, it doesn’t exist in Adalo at the moment. There is an active feature request for it: Guest tracking | Voters | Adalo
    There are several workaround strategies for that:
  • you can use an input field to store info. You’ll need to hide it, of course.
  • you can register all users anonymously, and store temporary information in user’s fields. However, this will require regular “cleaning” of this collection. Just in case, I’ve implemented “deferred” user login, see here: Adalo deferred login examples - YouTube - this was for ecommerce apps.
  1. Data access from the screens. In order to work with the collection, it should be available on the screen. For example, you can add a list to the screen, assign a collection to it, and work with the collection records using this list.
    As I understand, it is not possible to create a record in some collection when entering the screen, and after that work with it on the same screen. The workaround is to use the “intermediate” screen - which will create a record and then link to the 2nd screen. On the 2nd screen this record will be available.

And of course, best strategy will depend on what you would like to achieve :slight_smile:

1 Like

Dear both,

awesome. Thanks. That helps!
@Victor you were right about the 2 different things. I most likely can resolve the issue with pushing it to a second screen. However the other workarounds might come handy at some point as well.
Again thanks. Appreciate the fast response

Julian

1 Like

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