1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
497 views
by cliff-s-2873 (240 points)
I need to check PV1-7.2, PV1-8.2 OR PV19.2 for a last name in column 1 from a table called Provider... if it exists, change TXA-22 to the login name in column to in the Provider table.  

What's the best way to do this?

1 Answer

0 votes
 
Best answer

Here is a sample script to do what you are looking to do.

//Define Variables needed for script
var provider = '';

//check PV1-7.2
if (StringUtils.isNotBlank(qie.doTableLookup(message.getNode('PV1-7.2'), 'notFoundValue', 'tableName', 'column1', 'column2'))) {
   provider = qie.doTableLookup(message.getNode('PV1-7.2'), 'notFoundValue', 'tableName', 'column1', 'column2');
// check PV1-8.2   
} else if (StringUtils.isNotBlank(qie.doTableLookup(message.getNode('PV1-8.2'), 'notFoundValue', 'tableName', 'column1', 'column2'))) {
   provider = qie.doTableLookup(message.getNode('PV1-8.2'), 'notFoundValue', 'tableName', 'column1', 'column2');
//check PV1-9.2
} else if (StringUtils.isNotBlank(qie.doTableLookup(message.getNode('PV1-9.2'), 'notFoundValue', 'tableName', 'column1', 'column2'))) {
   provider = qie.doTableLookup(message.getNode('PV1-9.2'), 'notFoundValue', 'tableName', 'column1', 'column2');
}

//If the provider was found update TXA-22
if (StringUtils.isNotBlank(StringUtils.trim('provider'))) {
   message.setNode('TXA-22', provider);
}

by brandon-w-8204 (34.1k points)
edited by gary-t-8719
...