Narrow the videos displayed in the browsing component

As previously introduced here, it's possible to configure NativeVideo to record & display multiple videos associated to a specific Salesforce parent record.
By default, the VideoList component will display all videos associated to the parent record, but it is also possible to narrow the list with a criteria that can be simply configured.


Let's go back to the recruitment use case, introduced in the video interviews page. As we have discussed here, the hiring manager is entitled to either approve or reject each applicant from the face to face interview stage simply clicking on a VisualForce page embedded in NativeVideo. Once the hiring manager has expressed his judgement on the candidate, the overall status on the associated application record is changed to either Approved or Rejected. What we can easily imagine now is that the hiring manager will not want to see again a video where a decision has been already made, unless of specific circumstances.

Following this requirement, let's narrow down the list of videos, filtering by the status of the application, aiming to display just the interviews that have been submitted, but not reviewed.
In the Lightning App / Community Builder, open the vacancy page for the hiring manager and locate the VideoList component. In the list of parameters you will have to populate the values for:

  • "Filter By Where condition (Field)" with the Salesforce API name of field that should be used for the filtering
  • "Filter By Where condition (Value)" with the actual value to filter

If both parameters are specified, a LIKE condition is applied to the internal query that selects the junction records associated to the configured parent record.

If we consider our requirements, we should have then configured the VideoList component setting: 

  • "Filter By Where condition (Field)" as "Status__c"
  • "Filter By Where condition (Value)" as "Interview%Recorded"

Follow this configuration, we will be adding a Status__c LIKE 'Interview%Recorded' statement in the WHERE clause fetching the applications.


Finally, in case you have been wrapping the VideoList component in your own Lightning Component, you can follow exactly the same approach setting filterByWhereField and filterByWhereValue during the VideoList dynamic initialisation.



Conclusion & Next Steps

In this brief page we have introduced how a further filtering can be applied to the list of junction records associated to a parent record in a one to many scenario, both through a point and click interface and through code.
In the next chapter we will describe how to display more complex user interfaces to enable custom actions on each video - see more here.