Button Conditions Not Working As Expected

I’m trying to basically get a list button to create a record based on click if it doesn’t exist, or ignore the record if it does. The record can only either be created with the status of true (boolean), or not exist. The list that had the item, when clicked should disappear from view. Right now everything is in view even with the record in place, and I believe it’s because a Collections relationship isn’t right (not seeing options in the picker I expect), but they seem right…

The list is populated with data from the “tasks” collection, but the individual activities need to be in the “task progress” collection. I’m having a heck of a time getting the two to work in a meaningful way. I do get the listing of the tasks, and I can get the button to click and add a new record for the task, but I cannot use the record to exclude it from view in the list - I just get count options instead of the dynamic relationship I expect between task and task progress collection fields.

Quite hard to follow your issue, can you do a loom or veed.io?

Maybe before I do @Rozza , could you help me better understand the relationship I need to have for the flow? This is what I have so far:

Users - Can have multiple tasks and set task progress based on doing the tasks
Tasks - These are tied to task progress in a way, but essentially this is the data store for details on tasks
Task Progress - Here, tasks get recorded when completed and there should only be one record per task (there is only completed or not completed; not completed is basically an empty record)

I believe the conditions aren’t working right because something isn’t matching my expectations for these relationships in the collection…

I’d like a user to get their tasks, then basically click them when they are done, and then they disappear from display in the list once the record is created (indicating it’s complete).

The way they are set right now:
Users - relationship 1: one user to many tasks
Users - relationship 2: many users, many progresses
Tasks - relationship 1: many tasks, one users
Tasks - relationship 2: many tasks, many progresses
Task Progress - relationship 1: many task progresses, many tasks
Task Progress - relationship 2: many task progresses, many users

Does something look off?

Hi @Rninja

Conditions will kick your ass in Adalo, one minute it’s built and working, then snap. :exploding_head:
When they get too complex, or you involve counts it can break. Test every single time you change a visibility condition or conditional action.

I helped @LML888 on a call recently and he saw it first hand.

If a Task can only have one Task Progress? Just put the Task Progress fields in the Task collection. Have a boolean for completed.

I think you can simplify the backend which will mean less logic required on the front end.

Makes sense, that’s helpful. Well, the tasks collection is really just a place for me to store the tasks generally. It’s supposed to be issued generically to any user based on the day… So I didn’t want to attach a status to the task collection since it’s more of a read-only thing, allowing users to have their specific tasks recorded in the task progress collection. So far that is creating a challenge. In Glide apps, I was able to have a unique record by user which allowed this to work - but in Adalo, I am not sure how that can work…

In that case I would rely on an index integer given to each task. Then update the logged in user ‘current task (integer)’.

Your task collection is like a library.
When a task is completed, add it to tasks_completed, and use that as your reference table in lists of completed tasks.

I helped a forum member recently with the same kind of concept.
I can’t really go into much more detail without seeing the app.

@Rozza Is the index integer the same as the TaskID field that I added to the Tasks and Task Progress collections? I have the TaskID assigned when I create a record in Task Progress when a user clicks “completed” on the frontend. The TaskID also exists in the Tasks collection, but not altered.

Hey, sorry I don’t follow exactly your fields. The ‘index’ I talk of is not the record ID, but an integer you can use for sorting and filtering. Depending on the complexity of the app, order that records are inputted etc… you could use the record ID instead. Sounds like your Task ID field might be what is needed.

OK, created a loom, sorry about the length, but a bit to cover: Loom | Free Screen & Video Recording Software | Loom

OK thanks, had a very quick scan of your loom. It really is too much to pour over in great detail, book a 1-1 with myself or somebody else… but I think you could try another user > task relationship (completed tasks). Again, sorry but I can’t spend 10 mins in loom just to review the issue. The solution could probably be built in 15mins alone. I mean this in the kindest way. :+1:

How can I book some time with you @Rozza ?


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