Below is the code snippet found in my alert box or any variable. I need to update the values in product to different values such as 'Tremfya', 'Remicade', dynamically. These values are required for a specific product like "linename" and "wheretonavigate". How can I create a JavaScript function to achieve this?
function roadmaplist(product){
var product = '#~Product~#';
var PatientRoadMapList;
switch (product)
{
case 'Tremfya':
{
PatientRoadMapList =
[
{
"linename" : "Initiate Prior Authorization",
"whereToNavigate" : "InsuranceCoverage"
},
{
"linename" : "Instant Benefits Investigation",
"whereToNavigate" : "InsuranceCoverage"
},
{
"linename" : "Check Eligibility and Enroll Patient into Savings Program",
"whereToNavigate" : "SavingsProgram"
},
{
"linename" : "Enroll Patient into PsO Simple",
"whereToNavigate" : "TreatmentSupport"
},
{
"linename" : "Upload Signed Prescription",
"whereToNavigate" : "InsuranceCoverage"
}
];
break;
}
case 'Remicade':
{
PatientRoadMapList =
[
{
"linename" : "Initiate Prior Authorization",
"whereToNavigate" : "InsuranceCoverage"
},
{
"linename" : "Instant Benefits Investigation",
"whereToNavigate" : "InsuranceCoverage"
},
{
"linename" : "Check Eligibility and Enroll Patient into Savings Program",
"whereToNavigate" : "SavingsProgram"
}
];
break;
}
return PatientRoadMapList;