Update created database

Hello everybody

I’m a recent user of Adalo and I’m strulling with a functionnality I want to implement
My app is basic I’ve 2 database :

  • users with various informations and a unique ID for each users
  • predefined challenges with also a unique ID for each challenge and various informations

The user can see the list of challenges and select one to read it and complete the challenge.
So I created a 3rd data base creating a line each time a user click on a challenge, he can the update a boolean to say if the challenge is achieve or not.

But It only works if i check the box or not just after the creation. If I go back to a previously created challenge (for exemple yesterday) the app doesn’t know I’m selecting on previous line and I cannot update anything. Can you help me with this issue ?
Thanks a lot everybody

Regi

Hi @reginald,

In brief:

  • let’s assume your 3rd database is called “Taken Challenges” and has a relation to Challenge, User and some data about the date, completed, etc.
  • when user goes to the list of challenges (2nd DB), for the button “Take challenge” you need to set up conditional visibility: visible only if “Taken Challenges”->Count, Filtered by “Taken Challenge Name equals to current Challenge Name” plus User equals to Logged-in User, is equal to 0.
    This means that if there are NO records in “Taken Challenges” DB with the same name and logged-in user, button “Take challenge” is visible.
  • you could also add a label “this challenge is already taken” label with the opposite visibility logic (i.e. count > 0)
  • as for taken challenges, I’d suggest having a separate screen for them.

Here I avoid Many-to-Many relationships, as they seem to be slow sometimes.

Hope this helps

Best,
Victor.

Hello Victor !

Thanks for your answer. That was my issue I wanted to have the same page/list to see taken challenges and the standard list of challenge. That was impossible, as far as I know the tool !

So I’ll create another page to go to taken challenges. But now I’ve another problem, i’ve a boulean value column in this 3rd database. And when i create the list of all taken challenges I do not achieve to crate a filter for this information (with a dropdown menu). Is it possible ?

Thanks a lot,
Reginald

Hi @reginald,

This is not impossible, it just requires a bit of additional setup :slight_smile:

Here is the logic: you create a list of Challenges, then inside this list you have 2 buttons with conditional visibilities. One button is “Take challenge”. It will be visible only if Count of Logged-In User → TakenChallenges, filtered where TakenChallengeID equals to current ChallengeID, is equal to 0.
This “Count” means that you take all TakenChallenges of Logged-in user, search if there are challenges equal to current “Standard challenge”, and if there is no such entries - user can take a new challenge.

And the 2nd button will be a single-item list of Logged-In User → Taken Challenges, filtered by TakenChallengeID equals to current ChallengeID. Here if there is a taken challenge - you can lead the user to another screen (say, comments, complete, etc.).

The reason I’ve suggested having a separate screen - if you have say 50 challenges, and 25 taken challenges, it may take some time to load all these lists.

As for this question - general principle is: to work with any records, their data should be available on this screen.
So either you access the property via the list, or you have a relation between collections.

Hope this helps

Best,
Victor