Best way to direct the user to the next item

I have a learning platform where all the learning resources are nested inside sections
Both the sections and the resources are sorted by a number field “position”.
The “user” data type has a list of data type “resource_done” that host all the learning resources they finished

I’m adding a button “next resource” that will direct the user to the next resource they need to learn, and I wanted to hear your thoughts on how I wanted to do it and if there is a more efficient way?

My idea on how to do it:
Creating a data type “Last_Resource” that will update each time the user finishes a learning resource
it will have the following fields:
Resource - type resource
Section - type section

(1) When the user clicks on the “next resource” button it will search for a resource that has a “position” + 1 inside the current section, and if this resource is not inside the user’s “resource_done” list it will direct them to it.
(2) If the resource is on the “resource_done” list it will repeat the process when the position + 1 is the of the resource in the “resource_done” list
(3) If the isn’t a resource of that position inside the section, a new search will happen just like in (1) when the section position is +1 and repeat the entire process
(4) if there isn’t a section + 1 in (3) the system will look for a resource that isn’t finished in past sections starting with the section in position 1

It’s all sounds very inefficient to me, and this action needs to happen fast otherwise the user experience will be greatly damaged, do you have a better way to do it?

Hi there, @stavchark… if I understand your post correctly, you are already saving a list of completed resources on the User data type. So, when the Next Resource button is clicked, can’t you look at the last resource in the user’s list of completed resources and go from there? I could certainly be missing something here, but I’m not sure why a new data type would be necessary.

The above being said, one more thought did come to mind, though. If you really want it to be fast, you could consider adding a field on the User data type that always stores the next resource, and you could use a backend workflow to figure out what the next resource is. So, the user clicks the Next Resource button, you immediately send them to that resource because you have access to it via the new field, and you kick off a backend workflow to update the field with the next resource. Anyway, just food for thought.

Hope this helps.


First of all thanks a lot for the help! @mikeloc

The field for the user is an interesting idea, the problem is that a user learns multiple learning paths (courses)

I’m thinking of creating a data type that connects the user, the learning path, a the next resource that needs to be done, and update the resource field with a backend workflow

Do you think there is a more efficient way?

If there are multiple paths and there can be multiple next resources for a single user, then having a separate data type certainly sounds reasonable to me.

1 Like

Great, thanks a lot for the help! @mikeloc

1 Like