I am building a SAC analytic application and have never used javascript before. I have created a variable called Var_NextEvent. My datasource has a field that will contain A if the event is active. It may or may not have an active event but will never have more than one.
I want to search the field for "A" and if it finds it return the event name and store in variable for me to use in dynamic text box.
In the below example I would be storing 'Test2' in my variable.
This almost does what I need but instead of assigning "Active Event Identified" to the script variable when A is found I want to assign the value from the event name column.
var members = tbl_Mega.getDataSource().getMembers("4PRT001-EVENTSTATUS");
for (var i = 0;i <= members.length; i++) {
if (members[i].description.includes("A")) {
Var_ActiveEvent = true;
Var_NextEvent = "Active Event Identified";
break;
}
Var_ActiveEvent = false;
Var_NextEvent = "No Active Events";
break;
}
So to clarify if Event Status = A then look at the Event name and store in my variable. I hope this make sense.
Any help appreciated thank you.