on 02-27-2023 3:46 PM
Hi Team,
I am querying a DB and I want to write two csv files in parallel.
1. All the valid records as in skipping null/blank values, valid email id - File 1.csv
2. All invalid records as in null/blank records, invalid email id - file 2.csv
Inorder to determine whether email id is valid or not, I need to execute another query which will return the email domains maintained in DB.
How to achieve this ?
Thanks,
Varun
Hi srivarun15 - Will you try the below approach to achieve your requirement?
1. How to check if the email id is valid?
importClass(com.sap.gateway.ip.core.customdev.util.Message);
importClass(java.util.HashMap);
function processData(message) {
//Body
var emailBody = message.getBody();
var re = /\S+@\S+\.\S+/;
var result = re.test(emailBody);
message.setProperty("isValid", result);
return message;
}
2. Use isValid property in router function -> router conditions will create routes to take a decision
for example ${property.isValid} = true -> Take route 1 else route 2
Regards,
Karthik Arjun
SAP CPI | Fiori Senior Specialist
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.