Hi everyone! Essentially I have a dataset “HasUserWatchedVideo” and then a secondary dataset “projectOffice”. I have made a dynamic page for the project office dataset to list through all of the items that I want on the projectOffice page.
However if a user has already watched a video, their email and and ID code for the video gets added to HasUserWatchedVideo. What I am trying to do is filter the projectOffice dynamic page to only show videos that are left to be watched by viewers of this page.
Any ideas on how to make this work?
Thanks!
Sam
Do you really need two datasets?
Why not do it right this way…
- Creating the following database…
a) videos b) watched
a) = URL or STRING
b) = boolean (true / false)
That’s it!
It should then work like…
- First get the userID/ownerID
- then doing a query on your DATABASE
- filtering/searching for the owner id —> eq.(“_owner”, userID)
- then output result/results
- take a look if “watched” is setted to “true” or “false”
Now first try to code my suggestion.
You can do it by using a DATASET and you can also do it completely without a DATASET.
All you need you will find here…
https://www.wix.com/velo/reference/wix-data
…or here…
https://www.wix.com/velo/reference/wix-dataset
Hi, the reason that I require 2 datasets is that there will eventually be more, the HasUserWatchedVideo set will keep filling with rows everytime a user watches any video and the projectOffice dataset is a way of me ‘setting’ the videos like homework for all members that have access to that page. there will then be other datasets for the different departments. Does this make sense?
To try and help explain this I have made some Pseudocode of what I am trying to achieve:
for items in projectsOffice dataset
if CurrentUserEmail and videoID exists in the same record on HasUserWatchedVideo //meaning that the user has previously watched the video
filter out video with videoID from projectsOffice //don’t show this item
else
display video on dynamic page //show the item
Any ideas?