11 Replies Latest reply on Oct 12, 2016 1:20 AM by CarlSchwarz

    Random Video Selector by ID

    ezeitgeist

      Arggh! Okay, breathing.

       

      I had things working and then something stopped functioning.

       

      I am using Web Direct, if that changes anything.

       

      I want to create a way to load a random video each time a user enters the project.

       

      I have created a field (VideoRandom_ID) that does a calculation, that I was hoping would pull up a random Video_ID that would then be put in a gVideoSelector field that links to all video files, and thus calls up the selected Video in the Video_File container field on the main Dashboard.

       

      I know the gVideoSelector works (I also have it connected to a drop-down to select videos by name as well).

       

      I have an OnDashboardLoad script that takes the VideoRandom_ID and puts it in the gVideoSelector. The problem is, nothing comes out of my VideoRandom_ID calculation. Where am I off?!? Any help would be greatly appreciated.

       

      Calculation:

      Let ( [ number = Floor (( Random * (Count ( Videos by gVideoSelector 10::Video_ID )) ) + 1) ; result = GetNthRecord ( Videos by gVideoSelector 10::Video_ID ; number )]; result )