Select One with unique data in Oracle Visual Builder
Select One component is one of the seeded Oracle JET (OJET) components that allow us to populate data from backend API or Business Object or static. The data we receive from API or Business Object can have duplicate records and before we populate Select One, we may need to filter the duplicate data and populate select one choice with unique data.
So to meet this requirement, I have captured an end to end video that will help you to achieve the requirement.
Below is the snippet of JavaScript code to filter the duplicate data.
PageModule.prototype.unique = function(result) {
var uniqueResult = [];
var final = [];
if (result && result.length > 0) {
for (var i = 0; i < result.length; i++) {
if( !uniqueResult[result[i].department])
{
final.push({
department: result[i].department,
departmentName: result[i].departmentName,
});
uniqueResult[result[i].department] = 1;
}
}
}
return final;
}
Subscribe to my YouTube channel to get the latest videos on your notification list directly.
View more interesting videos
Get logged-in user credentials in Oracle VBCS
[…] Select One with unique data in Oracle Visual Builder […]