Share all details about your problem, including any error messages you may have received.
It is failing as I am returning NULL for various conditions. I wanted to aggregate only those accounts whose id starts with “1a”. For this requirement I have written above rule but getting issue as I am returning null. Can anyone help me with this. Thank you!
Instead of writing the build map rule, can you please fix your sql query " Simply add WHERE id LIKE '1a%' to your JDBC application’s SQL query.
If this works else use the below code, for returning empty map.
import sailpoint.connector.JDBCConnector;
import java.util.Map;
import java.util.HashMap;
Map map = JDBCConnector.buildMapFromResultSet(result, schema);
// Read ID safely
String id = (String) map.get("id");
// Skip if id is missing or doesn't start with "1a"
if (id == null || !id.startsWith("1a")) {
// Return empty map - connector will typically skip empty maps
return new HashMap();
}
// Return map for valid rows
return map;
Hi Naveen, we have tried with SQL query but for hands on I was trying both Customization and BuildMap way.
For me the customization rule was success but I haven’t been able to complete this task with BuildMap rule
IIQ requiresthe identity attribute (in your case “id”) to be present in the returned map for indexing. When you return new HashMap() , it has no “id” field, causing the error. try the below one and let me know, if it is fixed.
import sailpoint.connector.JDBCConnector;
import java.util.Map;
Map map = JDBCConnector.buildMapFromResultSet(result, schema);
String id = (String) map.get("id");
// Skip if id is missing or doesn't start with "1a"
if (id == null || !id.startsWith("1a")) {
return null;
}
return map;
I have already suggested that, and he has confirmed that, he is able to achieve it, via sql query and customization rule, but he wants to try with build map rule
Hi @toshal_selokar , It is recommended to use aggregation rules for such requirements. so i will advise you to use the customization rule to achieve the expected results.
I would suggest Toshal, not to proceed with this solution. Try updating your sql query with the condition and it will work. Build Map rule evaluates every identity, so it can impact the performance
Do not proceed with. this approach of adding the dummy account name in the map. You will end up aggregating account with the account name ‘IgnoreAccount‘ in SailPoint. Not recommended approach. Please go ahead with customization rule to implement this requirement.