Function does not return infotable with strings that were added
Hi,
The logic:
Infotable A has 2 columns.
Delete column 1 in infotable A.
Now the infotable has only 1 column.
Read each row of infotable A and compare with a string.
If there is a match, add some strings to infotable B.
Return infotable B.
I get no syntax errors, but my script returns infotable B with no data when I have a matching string in the if statement condition.
***********code*********************************************************
var params = {
infoTableName: "visibleOrgUnitInfoTable" /* STRING */
};
// result: INFOTABLE
var result = Resources["InfoTableFunctions"].CreateInfoTable(params);
//Add a new field to the InfoTable:
result.AddField({name: "visibleOrgUnits", baseType: "STRING"});
// result: INFOTABLE dataShape: EntityList
var currentUserOrgUnits = Resources["CurrentSessionInfo"].GetCurrentUserOrganizationalUnits();
currentUserOrgUnits.RemoveField('description');
for each (var rowThing in currentUserOrgUnits.row) {
if(rowThing.currentUserOrgUnits == "ABCOrg:ABCOrgUnit") {
// add data rows
result.AddRow({visibleOrgUnits : "ABC Org Unit A"});
result.AddRow({visibleOrgUnits : "ABC Org Unit B"});
result.AddRow({visibleOrgUnits : "ABC Org Unit C"});
result.AddRow({visibleOrgUnits : "ABC Org Unit D"});
result.AddRow({visibleOrgUnits : "ABC Org Unit E"});
result.AddRow({visibleOrgUnits : "ABC Org Unit F"});
result.AddRow({visibleOrgUnits : "ABC Org Unit G"});
}
}

