Extract variable in RITM and display except those who belong to vs_requestor variable set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 01:14 AM
Hi , I have a requirement to displaye all the variable present in the RITM but excluding the variables that are from vs_requestor variable set :
I have written the followling code and applied the filter condtion : if (current.variable_pool[vars].variable_set !== 'vs_amdocs_requestor') {
Still it is taking all the variables
code:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 01:25 AM
Hello @avinashdubey103
Please try below code
var table = current.getTableName();
var count = 0;
if (table == 'sysapproval_approver') {
count = 1;
} else {
for (vars in current.variable_pool) {
var variableSet = current.variable_pool[vars].item_option_new.variable_set;
// Add a condition to check if the variable definition's variable set is not 'vs_amdocs_requestor'
if (variableSet !== 'vs_amdocs_requestor') {
count++;
}
}
}
// Rest of your code...
Thank You
Kartik Magadum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 01:29 AM
Hi , it is printing the vs_amdocs_requestor vairables also
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 01:32 AM
Hi,
You can also look into:
var varsArr = new global.GlobalServiceCatalogUtil().getVariablesForTask(current, true);
gs.info(global.JSON.stringify(varsArr), null, 2);